{"id":13410114,"url":"https://github.com/tomlazar/table","last_synced_at":"2026-02-27T10:40:04.074Z","repository":{"id":39563587,"uuid":"297547220","full_name":"tomlazar/table","owner":"tomlazar","description":"pretty colorfull tables in go with less effort","archived":false,"fork":false,"pushed_at":"2023-05-19T15:58:46.000Z","size":122,"stargazers_count":51,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T20:27:28.982Z","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/tomlazar.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-09-22T05:42:34.000Z","updated_at":"2024-12-20T14:37:29.000Z","dependencies_parsed_at":"2024-01-08T14:30:52.856Z","dependency_job_id":"16251993-db0c-430c-8828-67fe4cdb9076","html_url":"https://github.com/tomlazar/table","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tomlazar/table","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlazar%2Ftable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlazar%2Ftable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlazar%2Ftable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlazar%2Ftable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomlazar","download_url":"https://codeload.github.com/tomlazar/table/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlazar%2Ftable/sbom","scorecard":{"id":892839,"data":{"date":"2025-08-18","repo":{"name":"github.com/tomlazar/table","commit":"858d4b646d6d9ab99a1b72b9c533c16a7c39d183"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/15 approved changesets -- score normalized to 0","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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/tomlazar/table/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/tomlazar/table/go.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/tomlazar/table/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   1 goCommand 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/40576783fda6698350fcbbeaea760ff827433034/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/go.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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T12:31:48.020Z","repository_id":39563587,"created_at":"2025-08-24T12:31:48.020Z","updated_at":"2025-08-24T12:31:48.020Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29892007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T09:48:51.284Z","status":"ssl_error","status_checked_at":"2026-02-27T09:48:43.992Z","response_time":57,"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":[],"created_at":"2024-07-30T20:01:05.043Z","updated_at":"2026-02-27T10:40:04.020Z","avatar_url":"https://github.com/tomlazar.png","language":"Go","readme":"# Table\n\n![Go](https://github.com/tomlazar/table/workflows/Go/badge.svg)\n[![codecov](https://codecov.io/gh/tomlazar/table/branch/main/graph/badge.svg?token=F96DTCC4MC)](undefined)\n[![GoDoc](https://godoc.org/github.com/tomlazar/table?status.svg)](http://godoc.org/github.com/tomlazar/table)\n[![Go Report Card](https://goreportcard.com/badge/github.com/tomlazar/table)](https://goreportcard.com/report/github.com/tomlazar/table)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftomlazar%2Ftable.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftomlazar%2Ftable?ref=badge_shield)\n\nPrint out tabular data on the command line using the ansi color esacape codes. Support for writing the ouput based on the fields in a struct and for defining and creating the table manully using the underlying object.\n\nSupport for colors on windows can be don using [mattn/go-colorable](https://github.com/mattn/go-colorable) to make a `io.Writer` that will work.\n\n## Usage\n\nFor creating a table yourself using the struct.\n```go\n\ttab := table.Table{\n\t\tHeaders: []string{\"something\", \"another\"},\n\t\tRows: [][]string{\n\t\t\t{\"1\", \"2\"},\n\t\t\t{\"3\", \"4\"},\n\t\t\t{\"3\", \"a longer piece of text that should stretch\"},\n\t\t\t{\"but this one is longer\", \"shorter now\"},\n\t\t},\n\t}\n\terr := tab.WriteTable(w, nil) // w is any io.Writer\n```\n![simple example](_examples/simple.png)\n\nWith a struct slice \n```go\n\tdata := []struct {\n\t\tName     string `table:\"THE NAME\"`\n\t\tLocation string `table:\"THE LOCATION\"`\n\t}{\n\t\t{\"name\", \"l\"},\n\t\t{\"namgfcxe\", \"asfdad\"},\n\t\t{\"namr3e\", \"l134151dsa\"},\n\t\t{\"namear\", \"lasd2135\"},\n\t}\n\n    err := table.MarshalTo(w, data, nil) // writes to any w = io.Writer\n    buf, err := table.Marshal(data, nil) // also supports return the bytes\n```\n![reflection](_examples/reflection.png)\n\n\nThe nil parameter is the configuration for the table, this can be set manually, but if its left as nil the deafult config settings will be used.\n```go\ntype Config struct {\n\tShowIndex       bool     // shows the index/row number as the first column\n\tColor           bool     // use the color codes in the output\n\tAlternateColors bool     // alternate the colors when writing\n\tTitleColorCode  string   // the ansi code for the title row\n\tAltColorCodes   []string // the ansi codes to alternate between\n}\n```\n\n\n## Installation \n\nGo makes this part easy.\n\n```bash\n$ go get github.com/mattn/go-colorable\n```\n\n## License\n\nMIT\n\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftomlazar%2Ftable.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftomlazar%2Ftable?ref=badge_large)\n\n## Author \n\nTom Lazar","funding_links":[],"categories":["Command Line","命令行","Build Automation","高级控制台UI`用于构建控制台应用程序和控制台用户界面的库.`","高级控制台UI"],"sub_categories":["Advanced Console UIs","高级控制台用户界面","标准 CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomlazar%2Ftable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomlazar%2Ftable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomlazar%2Ftable/lists"}