{"id":17146098,"url":"https://github.com/emersion/go-appdir","last_synced_at":"2025-04-13T11:32:35.554Z","repository":{"id":55666465,"uuid":"314551343","full_name":"emersion/go-appdir","owner":"emersion","description":"Go package to get application directories such as config and cache","archived":false,"fork":false,"pushed_at":"2020-12-14T09:20:44.000Z","size":20,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T12:16:15.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emersion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-20T12:44:38.000Z","updated_at":"2024-09-10T03:17:47.000Z","dependencies_parsed_at":"2022-08-15T06:00:40.422Z","dependency_job_id":null,"html_url":"https://github.com/emersion/go-appdir","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersion%2Fgo-appdir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersion%2Fgo-appdir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersion%2Fgo-appdir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emersion%2Fgo-appdir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emersion","download_url":"https://codeload.github.com/emersion/go-appdir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248705590,"owners_count":21148558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T21:07:50.150Z","updated_at":"2025-04-13T11:32:35.523Z","avatar_url":"https://github.com/emersion.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-appdir\n\n[![GoDoc](https://godoc.org/github.com/emersion/go-appdir?status.svg)](https://godoc.org/github.com/emersion/go-appdir)\n\nGo package to get application directories such as config and cache.\n\nPlatform | Windows | [Linux/BSDs] | [macOS]\n-------- | ------- | ------------------------------------------------------------------------------------------ | -----\nUser-specific config | `%APPDATA%` (`C:\\Users\\%USERNAME%\\AppData\\Roaming`) | `$XDG_CONFIG_HOME` (`$HOME/.config`) | `$HOME/Library/Application Support`\nUser-specific cache | `%LOCALAPPDATA%` (`C:\\Users\\%USERNAME%\\AppData\\Local`) | `$XDG_CACHE_HOME` (`$HOME/.cache`) | `$HOME/Library/Caches`\nUser-specific data | `%LOCALAPPDATA%` (`C:\\Users\\%USERNAME%\\AppData\\Local`) | `$XDG_DATA_HOME` (`$HOME/.local/share`) | `$HOME/Library/Application Support`\nUser-specific logs | `%LOCALAPPDATA%` (`C:\\Users\\%USERNAME%\\AppData\\Local`) | `$XDG_CACHE_HOME/\u003cname\u003e/logs` | `$HOME/Library/Logs`\n\n[Linux/BSDs]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html\n[macOS]: https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1\n\nInspired by [`configdir`](https://github.com/shibukawa/configdir).\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/emersion/go-appdir\"\n)\n\nfunc main() {\n\t// Get directories for our app\n\tdirs := appdir.New(\"my-awesome-app\")\n\n\t// Get user-specific config dir\n\tp := dirs.UserConfig()\n\n\t// Create our app config dir\n\tif err := os.MkdirAll(p, 0755); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Now we can use it\n\tf, err := os.Create(filepath.Join(p, \"config-file\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n\n\tf.Write([]byte(\"\u003c3\"))\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femersion%2Fgo-appdir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femersion%2Fgo-appdir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femersion%2Fgo-appdir/lists"}