{"id":13756373,"url":"https://github.com/rofrol/goshop","last_synced_at":"2025-04-13T18:34:36.599Z","repository":{"id":66526095,"uuid":"10201235","full_name":"rofrol/goshop","owner":"rofrol","description":"Shopping cart in Go","archived":false,"fork":false,"pushed_at":"2024-04-07T20:23:41.000Z","size":62,"stargazers_count":102,"open_issues_count":21,"forks_count":21,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-05T15:06:22.891Z","etag":null,"topics":[],"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/rofrol.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":"2013-05-21T17:22:42.000Z","updated_at":"2025-01-23T00:44:56.000Z","dependencies_parsed_at":"2024-08-03T11:02:01.343Z","dependency_job_id":null,"html_url":"https://github.com/rofrol/goshop","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/rofrol%2Fgoshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofrol%2Fgoshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofrol%2Fgoshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rofrol%2Fgoshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rofrol","download_url":"https://codeload.github.com/rofrol/goshop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248761079,"owners_count":21157485,"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":[],"created_at":"2024-08-03T11:00:43.099Z","updated_at":"2025-04-13T18:34:36.568Z","avatar_url":"https://github.com/rofrol.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\n# goshop\n\nPrepare go\n\n```shell\nGOPATH=~/projects/go\nmkdir -p $GOPATH\necho \"export GOPATH=$GOPATH\" \u003e\u003e ~/.bashrc\necho 'export PATH=$PATH:$GOPATH/bin' \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\ngoshop download\n\n```shell\ngo get github.com/rofrol/goshop\ncd $GOPATH/src/github.com/rofrol/goshop\n```\n\n\nDownload css and js\n\n```shell\nwget http://foundation.zurb.com/cdn/releases/foundation-5.0.3.zip\nunzip foundation-5.0.3.zip -d static/foundation\nrm foundation-5.0.3.zip\n```\n\nperm\n\ndownload openssl http://www.openssl.org/related/binaries.html\n\ngenerate cert http://stackoverflow.com/questions/10175812/how-to-build-a-self-signed-certificate-with-openssl\n\n```shell\nmkdir tls \u0026\u0026 cd tls\nopenssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes\n```\n\nRun it\n\n```shell\nsh db/init.sh\ngo get .\ngoshop\n```\n\nGo to https://localhost:9000 and https://localhost:9000/admin (login and password from `db/schema.sql`)\n\n## Go - Managing versions\n\nQ: How about automatic version managment in go?\n\nA: Versioning cannot be correctly done automatically for non trivial cases. The trivial cases are few minutes of manual work.\n\nQ: What is the proper way to manage two different versions of the same package\n\nA: The name of a package is equivalent to the first number of a semantic version -- e.g., a package foo exposes a backward compatible interface always and forever. If a breaking change becomes necessary, the name of the package changes to, e.g., foo2 or something.\n\nQ: where does the convention of package names being the major version come from? That is to use foo, foo2, foo3, etc.\n\nA: It comes from Rob Pike and the core Go development team. See the FAQ http://golang.org/doc/faq#get_version . He doesn't state it like I do though; but, the end result is the same. According to semver, if you make a breaking, incompatible change, you bump the 1st semver number. According to Go community convention, if you make a breaking change, you are advised to call your package a new name. The syntax of the \"name\" may be different, but the core ideas are the same.\n\nhttps://plus.google.com/113468371879331813621/posts/P4rcZAsHPTB\n\n## HTTP Redirect\n\nRemember to add return after Redirect, if you want to exit function.\n\n```shell\n\thttp.Redirect(w, r, \"/admin/products\", http.StatusSeeOther)\n\treturn\n```\n\nhttp://en.wikipedia.org/wiki/Post/Redirect/Get\n\nhttp://en.wikipedia.org/wiki/HTTP_303\n\n303 for HTTP 1.1, maybe problem with old corporate proxies, so 302 could be better\nhttp://stackoverflow.com/questions/46582/response-redirect-with-post-instead-of-get\n\nThe common practice is to redirect only after successful forms.\nSo forms with errors are treated by the same POST request, and so have\naccess to the data.\nhttps://groups.google.com/forum/?fromgroups#!msg/golang-nuts/HeAoybScSTU/qxp1H7mWZVYJ\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frofrol%2Fgoshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frofrol%2Fgoshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frofrol%2Fgoshop/lists"}