사용 관련

BindXXX

세팅

로컬 세팅

go get -u github.com/gin-gonic/gin
# gin이 vendor로 패키지 관리를 하고 있어 같이 받아준다
go get github.com/kardianos/govendor

# go 패키지에 별도 프로젝트를 만들어서 페치, 여기선 github.com/ground-x/gonic-test 로 만듬
cd go/src/github.com/ground-x/gonic-test
govendor init
govendor fetch github.com/gin-gonic/[email protected]
# 만약에 govendor cmd가 먹히지 않으면 vi ~/.bash_profile 로 go의 bin path를 추가한다
# export PATH=$PATH:/Users/myoungheejae/go/bin
vi main.go

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b2c67642-d758-4094-9886-0ec14b814e1a/_2019-10-22__11.53.32.png

go get -u github.com/go-sql-driver/mysql
create table test_schema.person(
	id int AUTO_INCREMENT,
    first_name varchar(10) not null,
    last_name varchar(10) not null,
    primary key(id)
);

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/af4fd819-9727-4046-a1ff-0a845882f03d/_2019-10-23__12.34.26.png