# Could not build serverless with golang

**URL:** <https://forum.serverless.com/t/could-not-build-serverless-with-golang/13290>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [December 3, 2020, 1:35pm UTC](https://forum.serverless.com/t/could-not-build-serverless-with-golang/13290 "2020-12-03T13:35:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lethienhoang](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/lethienhoang/32/4822_2.png) [@lethienhoang](https://forum.serverless.com/u/lethienhoang)\
**Post date:** [December 3, 2020, 1:35pm UTC](https://forum.serverless.com/t/could-not-build-serverless-with-golang/13290/1 "2020-12-03T13:35:16Z")

</div>

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\*\*

---

<div class="post-metadata">

**Author:** ![lethienhoang](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/lethienhoang/32/4822_2.png) [@lethienhoang](https://forum.serverless.com/u/lethienhoang)\
**Post date:** [December 4, 2020, 3:36pm UTC](https://forum.serverless.com/t/could-not-build-serverless-with-golang/13290/2 "2020-12-04T15:36:46Z")

</div>

Resolved. Pls close this question
