I use “make build” in command and I got that’s errors.
package channels/main.go is not in GOROOT (/usr/local/go/src/channels/main.go)
I have created the project with that’s command " sls create --template aws-go-mod --path myService
" outside Gopath
Makefile
.PHONY: build clean deploy gomodgen
build: gomodgen
export GO111MODULE=on
env GOOS=linux go build -ldflags="-s -w" -o bin/channels channels/main.go
env GOOS=linux go build -ldflags="-s -w" -o bin/messages messages/main.go
env GOOS=linux go build -ldflags="-s -w" -o bin/websockets websockets/main.go
clean:
rm -rf ./bin ./vendor Gopkg.lock
deploy: clean build
sls deploy --verbose
gomodgen:
chmod u+x gomod.sh
./gomod.sh
Folder structure:
Makefile
…
functions:
** channels**
** main.go**