• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    Go
  • Created over 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Shopping cart in Go

goshop

Prepare go

GOPATH=~/projects/go
mkdir -p $GOPATH
echo "export GOPATH=$GOPATH" >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
source ~/.bashrc

goshop download

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

perm

mkdir tls && cd tls
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

Run it

sh db/init.sh
go get .
goshop

Go to https://localhost:9000 and https://localhost:9000/admin (login and password from db/schema.sql)

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.

HTTP Redirect

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

More Repositories

1

awesome-wgpu

A curated list of wgpu code and resources.
334
star
2

awesome-elm-gamedev

A curated list of useful Elm tutorials, libraries and software for Game Development. Inspired by awesome list. Feel free to contribute.
164
star
3

elm-games

All Elm Games (hopefully)
137
star
4

elm-ui-cookbook

126
star
5

react-starter-kit

React starter kit - no need for grunt/gulp/gloop/glugle/gleffy/gloran/whatever task runner comes out next week
JavaScript
40
star
6

oceanic-next-jetbrains-theme

Oceanic Next Theme (UI) for JetBrains
25
star
7

elm-navigation-example

elm-lang/navigation example without using hashes
JavaScript
15
star
8

nix-for-javascript-developers

Nix language for Javascript developers
11
star
9

react-dropzone-progress-bar

react-dropzone with progress bar
JavaScript
11
star
10

dotfiles

Emacs Lisp
9
star
11

exherbo

Shell
9
star
12

stmux

stmux is a script to create tmux session with name taken from current directory and config file .tmux_session
Shell
7
star
13

color-gradient-algorithm

Python
5
star
14

monokai-ocean

A dark theme for Visual Studio Code - Monokai + Ocean background
5
star
15

zig-postgres-template

Zig
4
star
16

rust-juniper-example

Rust
4
star
17

elm-packages-stats

Show graph of number of elm packages
HTML
3
star
18

rust-shopping-bot

Rust
3
star
19

gplafferoshop

internet shop on gpl affero 3 licence
PHP
2
star
20

elm-code-editor

Elm code editor - embeddable
Elm
2
star
21

nixos-config

Nix
2
star
22

elm-image-slider

Elm
2
star
23

rust-hackerrank

http://hackerrank.com solutions
Rust
2
star
24

awesome-zig

2
star
25

guixsd-config

Scheme
2
star
26

rustommerce

Rust
2
star
27

scrape

Showcase what can be done in vanilla.js
JavaScript
2
star
28

zig-utils

A collection of utility scripts and tools I use for zig development
Shell
2
star
29

sortbytime

Rust
1
star
30

actix-web-juniper-trying

Rust
1
star
31

terminal-text-animation

JavaScript
1
star
32

calibre-library

1
star
33

go-koans-solution

my progress in https://github.com/cdarwin/go-koans
Go
1
star
34

java-scraping-jaunt

Java
1
star
35

elm-math-kids

Elm
1
star
36

rust-json-pretty-format

Rust
1
star
37

elm-input-live-search

Elm
1
star
38

angular_tree

in java
Java
1
star
39

flexbox-wrap-border-collapse

HTML
1
star
40

luna

Go
1
star
41

rust-regex-stdin-by-line-benchmark

Rust
1
star
42

rust-projecteuler

Rust
1
star
43

angular-input-time-chrome

JavaScript
1
star
44

angular-checkbox-tree

JavaScript
1
star
45

elm-elm-mdl-ripple-slow

Elm
1
star
46

angularjs-tree

JavaScript
1
star
47

.configs

Vim Script
1
star
48

miglayout

Automatically exported from code.google.com/p/miglayout
Java
1
star
49

ajv-regexp-errormessage-example

JavaScript
1
star
50

javascript-wtf-koans

1
star
51

elm-process-sleep-example

Elm
1
star