{"id":41482346,"url":"https://github.com/momaek/formattag","last_synced_at":"2026-01-23T17:38:55.890Z","repository":{"id":47215878,"uuid":"358507191","full_name":"momaek/formattag","owner":"momaek","description":"Align Golang struct tags","archived":false,"fork":false,"pushed_at":"2024-06-30T15:24:33.000Z","size":273,"stargazers_count":33,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-03T11:46:05.448Z","etag":null,"topics":["align","align-struct-tag","golang","pretty","structtags"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/momaek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-16T07:04:24.000Z","updated_at":"2024-06-30T15:24:36.000Z","dependencies_parsed_at":"2023-11-09T13:29:19.152Z","dependency_job_id":"0a3b0c77-99e2-4a3e-8b1b-b63b640f160e","html_url":"https://github.com/momaek/formattag","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/momaek/formattag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momaek%2Fformattag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momaek%2Fformattag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momaek%2Fformattag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momaek%2Fformattag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/momaek","download_url":"https://codeload.github.com/momaek/formattag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momaek%2Fformattag/sbom","scorecard":{"id":657899,"data":{"date":"2025-08-11","repo":{"name":"github.com/momaek/formattag","commit":"4d0751f7b94411bd41b967398008c241900dcd7c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 5/24 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/momaek/formattag/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/momaek/formattag/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/momaek/formattag/release.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.0.10 not signed: https://api.github.com/repos/momaek/formattag/releases/185330819","Warn: release artifact v0.0.9 not signed: https://api.github.com/repos/momaek/formattag/releases/113113177","Warn: release artifact v0.0.8 not signed: https://api.github.com/repos/momaek/formattag/releases/73393466","Warn: release artifact v0.0.7 not signed: https://api.github.com/repos/momaek/formattag/releases/68156461","Warn: release artifact v0.0.6 not signed: https://api.github.com/repos/momaek/formattag/releases/41814413","Warn: release artifact v0.0.10 does not have provenance: https://api.github.com/repos/momaek/formattag/releases/185330819","Warn: release artifact v0.0.9 does not have provenance: https://api.github.com/repos/momaek/formattag/releases/113113177","Warn: release artifact v0.0.8 does not have provenance: https://api.github.com/repos/momaek/formattag/releases/73393466","Warn: release artifact v0.0.7 does not have provenance: https://api.github.com/repos/momaek/formattag/releases/68156461","Warn: release artifact v0.0.6 does not have provenance: https://api.github.com/repos/momaek/formattag/releases/41814413"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T15:11:05.271Z","repository_id":47215878,"created_at":"2025-08-21T15:11:05.272Z","updated_at":"2025-08-21T15:11:05.272Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28696918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["align","align-struct-tag","golang","pretty","structtags"],"created_at":"2026-01-23T17:38:55.256Z","updated_at":"2026-01-23T17:38:55.884Z","avatar_url":"https://github.com/momaek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Formattag\n\nThe tool is used to align golang struct's tags.\n\neg.:\n\nBefore\n```golang\n// TestStruct this is a test struct\ntype TestStruct struct {\n\tID            string `json:\"id\" xml:\"id\"`\n\tIfNotModified string `json:\"if_not_modified\" xml:\"if_not_modified\"`\n\tName          string `json:\"name\" xml:\"name\"`\n\n\tThisIsAStructWodeTianNa struct {\n\t\tFieldFromThisIsAStructWodeTianNa string `json:\"field_from_this_is_a_struct_wode_tian_na\" xml:\"field_from_this_is_a_struct_wode_tian_na\"`\n\t\tTianName                         string `json:\"tian_name\" xml:\"tian_name\"`\n\t} `json:\"this_is_a_struct_wode_tian_na\" xml:\"this_is_a_struct_wode_tian_na\"`\n\n\tT    time.Time `json:\"t\" xml:\"t\"`\n\tFset Fset      `json:\"fset\" xml:\"fset\"`\n}\n\ntype Fset struct{}\n\n```\n\nAfter\n```golang\n// TestStruct this is a test struct\ntype TestStruct struct {\n\tID            string `json:\"id\"              xml:\"id\"`\n\tIfNotModified string `json:\"if_not_modified\" xml:\"if_not_modified\"`\n\tName          string `json:\"name\"            xml:\"name\"`\n\n\tThisIsAStructWodeTianNa struct {\n\t\tFieldFromThisIsAStructWodeTianNa string `json:\"field_from_this_is_a_struct_wode_tian_na\" xml:\"field_from_this_is_a_struct_wode_tian_na\"`\n\t\tTianName                         string `json:\"tian_name\"                                xml:\"tian_name\"`\n\t} `json:\"this_is_a_struct_wode_tian_na\" xml:\"this_is_a_struct_wode_tian_na\"`\n\n\tT    time.Time `json:\"t\"    xml:\"t\"`\n\tFset Fset      `json:\"fset\" xml:\"fset\"`\n}\n\ntype Fset struct{}\n```\n\n### Installation\n\n####  Using go install\n\n```\ngo install github.com/momaek/formattag@latest\n```\n\n\n####  Compile from source\nCompile from source, which requires [Go 1.18 or newer](https://golang.org/doc/install):\n```\ngit clone github.com/momaek/formattag\ncd formattag \u0026\u0026 go build .\n```\n\n#### Prebuild binaries\nPlease check the [release page](https://github.com/momaek/formattag/releases) and download the lastest release.\n\n### Usage\n\n```\nformattag -file /path/to/your/golang/file\n```\n\n**This command will change your go file.**\n\nIf you want print result on console:\n```\nformattag -file /path/to/your/golang/file -C \n```\n\nYou can also get input from stdin(result will be print on console):\n```\ncat /path/to/your/golang/file | formattag\n```\n\n#### Vim\nIf you're using vim or nvim, you'd better install from source.\n\nAdd the following snippet to your ~/.vimrc:\n```\nset rtp+={/path/to/your/downloaded/source}/formattag/vim\n```\nRunning `:PrettyTag` will run formattag on the current file.\n\nOptionally, add this to your `~/.vimrc` to automatically run `formattag` on :w\n```\nautocmd BufWritePost,FileWritePost *.go execute 'PrettyTag' | checktime\n```\n\n#### Emacs\n\nPlease check [https://github.com/M1ndo/gofmt-tag](https://github.com/M1ndo/gofmt-tag).\n\nProvided by [M1ndo](https://github.com/M1ndo)\n\n#### VSCode\nPlease Install [Run On Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave)\nAdd the following code snippet to `settings.json`.\n```json\n{\n    \"match\": \"\\\\.go$\",\n    \"isAsync\": false,\n    \"cmd\": \"/path/to/formattag -file ${file}\"\n}\n```\n\n#### GoLand\ne.g.\n![](images/goland_set.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomaek%2Fformattag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomaek%2Fformattag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomaek%2Fformattag/lists"}