{"id":20832904,"url":"https://github.com/udhos/modhello","last_synced_at":"2026-05-21T03:31:52.494Z","repository":{"id":57524092,"uuid":"142218964","full_name":"udhos/modhello","owner":"udhos","description":"modhello - starter recipe for working with golang modules","archived":false,"fork":false,"pushed_at":"2018-08-27T21:25:05.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-12-21T05:24:12.518Z","etag":null,"topics":["go","go-modules","modules"],"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/udhos.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":"2018-07-24T22:27:32.000Z","updated_at":"2022-08-13T17:29:08.000Z","dependencies_parsed_at":"2022-09-26T18:10:56.084Z","dependency_job_id":null,"html_url":"https://github.com/udhos/modhello","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fmodhello","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fmodhello/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fmodhello/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fmodhello/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udhos","download_url":"https://codeload.github.com/udhos/modhello/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234565075,"owners_count":18853247,"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":["go","go-modules","modules"],"created_at":"2024-11-18T00:13:37.838Z","updated_at":"2025-12-28T06:28:13.697Z","avatar_url":"https://github.com/udhos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# modhello\n\nRecipe based on https://github.com/golang/go/wiki/Modules\n\n    Repo:    modhello\n    Module:  modhello/modlib     -- go.mod lives here\n    Package: modhello/modlib/lib -- this is imported from go code\n\n## Highlights\n\n- Host multiple modules under single repo.\n- Host multiple packages under single module.\n- Modules depend on full modules (not individual packages).\n- Go code imports packages (not modules).\n- import \"domain.com/repo/module/package\" for package (v0 or v1).\n- import \"domain.com/repo/module/v2/package\" for package v2.\n- Two ways to release v2 or higher:\n  1. Update the go.mod file to include a /v2 at the end of the module path.\n  2. Alternatively, create a v2 directory with a new go.mod file defining the module path ending with /v2.\n- Tag the repository with \u003cmodulename\u003e/vX.X.X to publish new version for specific module.\n\n## How to add intial Go Modules support for a repository\n\n    git clone https://.../repo ;# must clone outside of GOPATH\n    cd repo\n    go mod init\n    go mod tidy\n    git add go.mod go.sum\n    git commit\n    git push\n\n## Recipe\n\nDefine module modlib.\n\n    $ cat modhello/modlib/go.mod\n    module github.com/udhos/modhello/modlib\n\nDefine module modapp. Notice that modapp requires modlib v1.0.0.\n\n    $ cat modhello/modapp/go.mod\n    module github.com/udhos/modhello/modapp\n\n    require github.com/udhos/modhello/modlib v1.0.0\n\nPublish version v1.0.0 for modlib.\n\n    $ cd modhello\n    $ git tag modlib/v1.0.0\n    $ git push origin modlib/v1.0.0 ;# publish tag\n\nBuild the app.\n\n    $ cd modhello/modapp\n    $ go install\n\nPublish new version v2.0.0 for modlib.\n\n    $ cd modhello\n    # Define modlib/v2/go.mod\n    $ cat modlib/v2/go.mod\n    module github.com/udhos/modhello/modlib/v2\n    $ git add modlib/v2/go.mod\n    $ git commit\n    $ git tag modlib/v2.0.0\n    $ git push --all\n    $ git push origin modlib/v2.0.0 ;# publish tag\n\nCreate new app modhot depending on modlib v2.0.0.\n\n    $ cat modhello/modhot/go.mod\n    module github.com/udhos/modhello/modhot\n\n    require github.com/udhos/modhello/modlib/v2 v2.0.0\n\nBuild new app.\n\n    $ cd modhello/modhot\n    $ go install\n\n## How to update Modules used by your application\n\n### Non-major update\n\nBy default, Go will not update modules without being asked.\n\n    $ go get -u                                ;# use the latest minor or patch releases\n    $ go get -u=patch                          ;# use the latest patch releases (to 1.0.1 but not to 1.1.0)\n    $ go get github.com/user/testmodule@v1.0.1 ;# update to a specific version\n\n### Major update\n\nThe major version is for all intents and purposes a completely different package.\n\n    import \"github.com/user/testmodule/v2/pkg\"\n\n## See also\n\nhttps://roberto.selbach.ca/intro-to-go-modules/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudhos%2Fmodhello","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudhos%2Fmodhello","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudhos%2Fmodhello/lists"}