tmp
Showing posts with label
Go
.
Show all posts
Showing posts with label
Go
.
Show all posts
Wednesday, February 6, 2019
go modules
## Requirement `go 1.11` higher ```bash $ go version go version go1.11.2 darwin/amd64 ``` ## `GO111MODULE` * unset or `auto` `GOPATH` 内部の場合はモジュールモードoff `GOPATH` 外部の場合はモジュールモードon * `on` 全ての場所でモジュールモードon * `off` 全ての場所でモジュールモードoff ## Commands ### Initialize ``` go mod init
``` `go.mod` が作成される ### Run ``` go run . ``` importに応じて勝手にビルドされる `go.sum` が作成される ### Build ``` go build ``` importに応じて勝手にビルドされる `go.sum` が作成される ### Get specific version ``` go get github.com/appleboy/gin-jwt@master ``` 特定の branch, version を入れる場合 ``` go mod edit -require=github.com/appleboy/gin-jwt@master go build ``` これでも同じ結果になる ## 参考 * https://github.com/golang/go/wiki/Modules * https://qiita.com/spiegel-im-spiegel/items/5cb1587cb55d6f6a34d7 * https://budougumi0617.github.io/2018/05/10/go-get-from-go1-tag-or-branch/ * https://text.baldanders.info/golang/go-module-aware-mode/
Tuesday, January 22, 2019
Golang links
## Documents * https://github.com/golang/go/wiki * https://golang.org/pkg/ ### samples * https://github.com/GoogleCloudPlatform/golang-samples/tree/master/getting-started ## native な router の実装 * https://gist.github.com/reagent/043da4661d2984e9ecb1ccb5343bf438 ## Framework 最近だと Gin, gollira/mux http-router or go-json-rest あたりか * https://qiita.com/najeira/items/bdc988c4e93b3b5ccf2f * https://github.com/mingrammer/go-web-framework-stars * https://github.com/ant0ine/go-json-rest * https://github.com/gin-gonic/gin ## RESTful API の実装 * https://medium.com/@thedevsaddam/build-restful-api-service-in-golang-using-gin-gonic-framework-85b1a6e176f3 * http://sgykfjsm.github.io/blog/2016/03/13/golang-json-api-tutorial/ * https://github.com/mingrammer/go-todo-rest-api-example * https://medium.com/@swanandkeskar/rest-api-using-go-and-gorilla-mux-91cf63956de * https://medium.com/eureka-engineering/go%E8%A8%80%E8%AA%9E%E8%A3%BDwaf-gin%E3%81%A7web%E3%82%A2%E3%83%97%E3%83%AA%E3%82%92%E4%BD%9C%E3%81%A3%E3%81%A6%E3%81%BF%E3%82%8B-%E6%BA%96%E5%82%99%E7%B7%A8-6f14aba0da29 ## DDD * https://www.slideshare.net/pospome/go-80591000 * https://engineer.recruit-lifestyle.co.jp/techblog/2018-03-16-go-ddd/ * https://hackernoon.com/golang-clean-archithecture-efd6d7c43047 * https://eng-blog.iij.ad.jp/archives/2442 * https://postd.cc/golang-clean-archithecture/ * https://little-hands.hatenablog.com/entry/2018/12/10/ddd-architecture * https://qiita.com/trrrrrys/items/4286ca3d015e252800c3 ### Standard layout * https://github.com/golang-standards/project-layout * https://qiita.com/sueken/items/87093e5941bfbc09bea8#web ### samples * https://qiita.com/trrrrrys/items/44e839134af1a0155be2 * https://github.com/trrrrrys/blogapi * https://github.com/shotat/ggg/blob/master/interfaces/api/server/router/router.go * https://github.com/hatajoe/8am * https://github.com/nakabonne/cleanarchitecture-sample ## Go+Docker * https://medium.com/statuscode/golang-docker-for-development-and-production-ce3ad4e69673 * https://semaphoreci.com/community/tutorials/how-to-deploy-a-go-web-application-with-docker * https://docs.microsoft.com/ja-jp/azure/app-service/containers/quickstart-docker-go ## links * https://qiita.com/MahoTakara/items/10fede35c03db1e3b849#%E3%82%A8%E3%83%87%E3%82%A3%E3%82%BF%E3%82%84ide
Monday, July 28, 2014
hello go world
Go言語でhello worldを出すまで ##install MacPortsで(Homebrewやpkgからでも入れられる) ```bash sudo port install go ``` ###確認 ```bash $ go version go version go1.3 darwin/amd64 ``` ##hello.go作成 ```go package main import "fmt" func main() { fmt.Printf("hello, world\n") } ``` ##run ```bash $ go run hello.go hello, world ``` ##参考 *
*
*
Older Posts
Home
Subscribe to:
Posts (Atom)