GOPATH=~/projects/go mkdir -p $GOPATH echo "export GOPATH=$GOPATH" >> ~/.bashrc echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc source ~/.bashrc
go get github.com/rofrol/goshop cd $GOPATH/src/github.com/rofrol/goshop
Download css and js
wget http://foundation.zurb.com/cdn/releases/foundation-5.0.3.zip unzip foundation-5.0.3.zip -d static/foundation rm foundation-5.0.3.zip
download openssl http://www.openssl.org/related/binaries.html
mkdir tls && cd tls openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes
sh db/init.sh go get . goshop
Go - Managing versions
Q: How about automatic version managment in go? A: Versioning cannot be correctly done automatically for non trivial cases. The trivial cases are few minutes of manual work.
Q: What is the proper way to manage two different versions of the same package A: 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.
Q: where does the convention of package names being the major version come from? That is to use foo, foo2, foo3, etc. A: 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.
Remember to add return after Redirect, if you want to exit function.
http.Redirect(w, r, "/admin/products", http.StatusSeeOther) return
303 for HTTP 1.1, maybe problem with old corporate proxies, so 302 could be better http://stackoverflow.com/questions/46582/response-redirect-with-post-instead-of-get
The common practice is to redirect only after successful forms. So forms with errors are treated by the same POST request, and so have access to the data. https://groups.google.com/forum/?fromgroups#!msg/golang-nuts/HeAoybScSTU/qxp1H7mWZVYJ