1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Serverless frameworkでGoをデプロイしたらPath errorが発生する

Posted at

はじめに

この記事は2022年8月にまとめていた「細かいつまずいたことをメモしておく(8月編)をそれぞれ投稿した内容になります
解決方法が最新でない可能性もありますのでご了承ください

問題

この記事をみて設定をしていたがいざデプロイすると以下のエラーが発生

image.png

解決方法

build:
	go mod download
	env CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -o bin/main handler/main.go
set GOOS=linux
set GOARCH=amd64
set CGO_ENABLED=0

これを追加すればできた
CGO_ENABLEも追加しないとできなかった

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?