/go-docker-devenv

Primary LanguageVim ScriptMIT LicenseMIT

Initially forked from https://github.com/mbrt

go-vim Docker image

This Docker image adds Go tools and the following vim plugins to the official Go image:

Usage

Run this image from within your go workspace. You can than edit your project using vim, and usual go commands: go build, go run, etc.

cd your_project
docker run --rm -tiv `pwd`/src:/app -w /app goide

Swagger

https://medium.com/@pedram.esmaeeli/generate-swagger-specification-from-go-source-code-648615f7b9d9

GO111MODULE=off swagger generate spec -o ./swagger.yaml --scan-models

GRPC

grpc/grpc-go#3794 (comment)

protoc --go_out=. \
	--go-grpc_out=require_unimplemented_servers=false:. \
	--openapiv2_out=. \
	--grpc-gateway_out=. \
	./*.proto

Google APIs Should be picked up automatically by protoc from following directory. No need to explicitly to be specified

/usr/local/include/google 

Debugging

Image has Delve installed, same as plugins for vim. Feel free to

dlv test -- -test.run=NAME_OF_FUNC
dlv debug SOURCES.go

or inside vim

:GoDebugStart
:GoDebugTest
:GoDebugTestFunc