golang tokyo go tools

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
mom0tomo
April 19, 2019

golang tokyo go tools

mom0tomo

April 19, 2019

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

23 slides
  1. Go ͸ίϚϯυ/πʔϧ͕ॆ࣮ͯ͠ ͍Δ • go ίϚϯυ • go tool •

    ඪ४ɾ४ඪ४ύοέʔδͰఏڙ͞Ε͍ͯΔ • IDEʹཔΒͳͯ͘΋շదʹ։ൃͰ͖Δ
  2. $ go env GOARCH="amd64" GOBIN="" GOCACHE="/home/alex/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux"

    GOOS="linux" GOPATH="/home/alex/go" GOPROXY="" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go- build245740092=/tmp/go-build -gno-record-gcc-switches" 14
  3. $ gofmt . $ gofmt foo.go // Options // -d

    : diffΛඪ४ग़ྗ͢Δ // -l : ϑΝΠϧ໊Λඪ४ग़ྗ͢Δ // -w : ্ॻ͖อଘ͢Δ // -s : ه๏Λγϯϓϧʹ͢Δ // Ұཡ͸ https://godoc.org/github.com/gophersjp/go/src/cmd/gofmt 17
  4. $ go fmt . $ go fmt foo.go // $

    gofmt -l -w ͱಉ͡͸ͨΒ͖ // formatͨ͠಺༰Ͱ্ॻ͖ͯ͠ϑΝΠϧ໊Λඪ४ग़ྗ͢Δ 18
  5. $ go vet . $ go vet foo.go // ίʔυΛ੩తղੳͯ͠ه๏ΛνΣοΫ͢Δ

    // ίϯύΠϥʹ͸ݕ஌Ͱ͖ͳ͍΋ͷΛݟ͚ͭͯ͘ΕΔ 20

More Decks by mom0tomo

Other Decks in Technology