{"id":15663006,"url":"https://github.com/keinos/hello-cobra","last_synced_at":"2025-05-06T02:33:28.012Z","repository":{"id":42518435,"uuid":"309346437","full_name":"KEINOS/Hello-Cobra","owner":"KEINOS","description":"✅   Hello, world! sample/example of Cobra in Golang with a 100% coverage test.","archived":false,"fork":false,"pushed_at":"2023-05-02T15:39:34.000Z","size":213,"stargazers_count":19,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T01:13:26.189Z","etag":null,"topics":["cobra","go","golang","hello-world","hello-world-for-beginner","helloworld","helloworld-demo"],"latest_commit_sha":null,"homepage":"","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/KEINOS.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":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-02T11:14:50.000Z","updated_at":"2024-08-06T11:24:36.000Z","dependencies_parsed_at":"2024-06-19T14:34:00.287Z","dependency_job_id":"31fa25fd-b33e-4921-8878-eb29fb79d041","html_url":"https://github.com/KEINOS/Hello-Cobra","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FHello-Cobra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FHello-Cobra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FHello-Cobra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KEINOS%2FHello-Cobra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KEINOS","download_url":"https://codeload.github.com/KEINOS/Hello-Cobra/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252609919,"owners_count":21775904,"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":["cobra","go","golang","hello-world","hello-world-for-beginner","helloworld","helloworld-demo"],"created_at":"2024-10-03T13:35:13.682Z","updated_at":"2025-05-06T02:33:27.989Z","avatar_url":"https://github.com/KEINOS.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD001 MD041 --\u003e\n[![go1.15+](https://img.shields.io/badge/Go-1.15,%2016,%2017,%2018,%20latest-blue?logo=go)](https://github.com/KEINOS/dev-go/actions/workflows/go-versions.yml \"Supported versions\")\n[![Go Reference](https://pkg.go.dev/badge/github.com/KEINOS/Hello-Cobra.svg)](https://pkg.go.dev/github.com/KEINOS/Hello-Cobra#section-documentation \"Read generated documentation of the app\")\n\n# \"Hello, world!\" example of Cobra with 100% code coverage\n\n\u003e __Note__ : \"`Cobra`\" is an awesome framework of Go to help create CLI apps.\n\n__This repo is an example of [Cobra](https://cobra.dev/)'s \"`Hello, world!`\" with 100% code coverage__.\n\nIncluding the below to just say \"Hello\" to the world!\n\n- [CI](./github/workflows/)\n  - Unit tests on Go v1.15 to the latest.\n  - Static analysis, security scan, lint and format check.\n  - Monthly vulnerability scan via CodeQL.\n  - Automated monthly update of `go.mod` and `go.sum` on test-pass.\n- Automated [Homebrew release](https://github.com/KEINOS/homebrew-Hello-Cobra) on release push.\n\n## Searching for the best practices of Cobra\n\n__We all know keeping 100% of code coverage is a myth__. But as a `Golang` and `Cobra` beginner, we wanted a \"Hello-world\" example with 100% of coverage, which couldn't be found by _googling_ for \"[`golang` `cobra` `sample` `example` `hello` `world` `coverage` `100%`](https://www.google.com/search?q=%22golang%22+cobra+sample+example+hello+world+coverage+100%)\".\n\nThis repo aims to find the best-practices of `Cobra` by refactoring it on a moment-to-moment basis. But keeping the code coverage as high as possible and less complexity as possible.\n\n- Therefore, this is a forever-[WIP](https://en.wikipedia.org/wiki/Work_in_progress)-repo.\n  So any [PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for the better is welcome!!  We will merge it as long as it passess the tests with 100% coverage and not a prank-kind PR.\n  - Branch to PR: `main`\n\n## Statuses\n\n[![Test on macOS/Win/Linux](https://github.com/KEINOS/Hello-Cobra/actions/workflows/platform-test.yaml/badge.svg)](https://github.com/KEINOS/Hello-Cobra/actions/workflows/platform-test.yaml)\n[![go1.15+](https://github.com/KEINOS/Hello-Cobra/actions/workflows/version-tests.yaml/badge.svg)](https://github.com/KEINOS/Hello-Cobra/actions/workflows/version-tests.yaml)\n[![golangci-lint](https://github.com/KEINOS/Hello-Cobra/actions/workflows/golangci-lint.yaml/badge.svg)](https://github.com/KEINOS/Hello-Cobra/actions/workflows/golangci-lint.yaml)\n[![codecov](https://codecov.io/gh/KEINOS/Hello-Cobra/branch/main/graph/badge.svg?token=R2B9UBIEUI)](https://codecov.io/gh/KEINOS/Hello-Cobra \"View details on CodeCov.IO\")\n[![Go Report Card](https://goreportcard.com/badge/github.com/KEINOS/Hello-Cobra)](https://goreportcard.com/report/github.com/KEINOS/Hello-Cobra \"View on Go Report Card\")\n[![CodeQL](https://github.com/KEINOS/Hello-Cobra/actions/workflows/codeQL-analysis.yaml/badge.svg)](https://github.com/KEINOS/Hello-Cobra/actions/workflows/codeQL-analysis.yaml \"Vulnerability Scan\")\n\n## Note\n\n- This example app supports Homebrew installation. To know how it works see: [.goreleaser.yml](./.goreleaser.yml)\n\n    ```bash\n    brew install KEINOS/Hello-Cobra/hello-cobra\n    ```\n\n    ```shellsession\n    $ brew install KEINOS/Hello-Cobra/hello-cobra\n    ==\u003e Tapping keinos/hello-cobra\n    ... **snip** ...\n    ==\u003e Installing hello-cobra from keinos/hello-cobra\n    ... **snip** ...\n\n    $ hello-cobra --version\n    hello-cobra version 1.3.2-alpha (c3c9eab)\n\n    $ hello-cobra hello foo bar\n    Hello, foo and bar!\n\n    $ hello-cobra hello foo bar --reverse\n    !rab dna oof ,olleH\n    ```\n\n- This package auto-detects the app version from the `git` tag if the app was installed via `go install` (on Go v1.16+) or `go get -u` (on Go 1.15). Try:\n\n    ```bash\n    # For Go 1.16 or above\n    cd /tmp\n    go install \"github.com/KEINOS/Hello-Cobra/hello-cobra@latest\"\n    hello-cobra --version\n    # Output: hello-cobra version v1.3.0\n    ```\n\n    ```bash\n    # For Go 1.15\n    cd /tmp\n    GO111MODULE=\"on\" go get -u \"github.com/KEINOS/Hello-Cobra/hello-cobra@latest\"\n    hello-cobra --version\n    # Output: hello-cobra version v1.3.0\n    ```\n\n- This repo updates monthly the `go.mod` and `go.sum` files if all the tests succeeds to run in all Go versions (Go v1.15~latest).\n\n## License\n\nThe repo itself is MIT License. (c) Copyright, [Hello-Cobra Contributors](https://github.com/KEINOS/Hello-Cobra/graphs/contributors).\n\nBUT any app created from this repo as a template/boilerplate may have its willing license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeinos%2Fhello-cobra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeinos%2Fhello-cobra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeinos%2Fhello-cobra/lists"}