{"id":22214015,"url":"https://github.com/xmlking/go_project","last_synced_at":"2025-03-25T06:24:05.392Z","repository":{"id":142313627,"uuid":"171181501","full_name":"xmlking/go_project","owner":"xmlking","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-26T21:25:21.000Z","size":1297,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T05:43:23.623Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/xmlking.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}},"created_at":"2019-02-17T22:49:20.000Z","updated_at":"2019-05-26T21:25:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"9569aa5c-f930-4114-9d21-09d47aff29d8","html_url":"https://github.com/xmlking/go_project","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fgo_project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fgo_project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fgo_project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Fgo_project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmlking","download_url":"https://codeload.github.com/xmlking/go_project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245409581,"owners_count":20610556,"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":["golang"],"created_at":"2024-12-02T21:12:58.186Z","updated_at":"2025-03-25T06:24:05.366Z","avatar_url":"https://github.com/xmlking.png","language":"Dockerfile","readme":"# Go Demo Project\n\u003e Example of a project with `n` commands and `n` packages\n\n## Commands\n```bash\n# Init mod\ngo mod init\n## or\ngo mod init github.com/xmlking/go_project\n\n# Run\ngo run cmd/great1/great1.go -name MyCodeSmells\ngo run cmd/great2/great2.go -name MyCodeSmells\ngo run main.go\n\n# Build\ngo build -v -o bin/great1 cmd/great1/great1.go\ngo build -v -o bin/great2 cmd/great2/great2.go\ngo build -v -o bin/app .\n\n# Build for mac\nGOOS=darwin GOARCH=amd64 go build -v -o bin/darwin/great1 cmd/great1/great1.go\n# Build for linux\nGOOS=linux GOARCH=amd64 go build -v -o bin/linux/great1 cmd/great1/great1.go\n\ngo install\n\n# Run binary\n./bin/great1 -name MyCodeSmells\n./bin/great2 -name MyCodeSmells\n./bin/app\n```\n\n## Docker\n\n### Build\n```bash\n# build\nVERSION=0.0.1-SNAPSHOT\ndocker build \\\n--build-arg VERSION=$VERSION \\\n--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \\\n-t xmlking/go-app . \n\n# tag\ndocker tag xmlking/go-app xmlking/go-app:$VERSION\n\n# push\ndocker push xmlking/go-app:$VERSION\ndocker push xmlking/go-app:latest\n\n# check\ndocker inspect  xmlking/go-app:$VERSION\ndocker image prune -f\n```\n\n### Run\n```bash\ndocker run -it -p 80:8080  xmlking/go-app\n```\n\n## Ref\n1. https://roberto.selbach.ca/intro-to-go-modules/\n2. https://www.mycodesmells.com/post/go-modules-example\n3. https://flaviocopes.com/go-filesystem-structure/\n\n4. [Using go mod download to speed up Golang Docker builds](https://medium.com/@pierreprinetti/the-go-1-11-dockerfile-a3218319d191) \n5. [idiomatic in-place error handling](https://evilmartians.com/chronicles/errors-in-go-from-denial-to-acceptance)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Fgo_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmlking%2Fgo_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Fgo_project/lists"}