소스는 문제가 없다.

server.go

package main

import (
    "net/http"
    "github.com/labstack/echo"
)

func main() {
    e := echo.New()
    e.GET("/", func(c echo.Context) error {
        return c.String(http.StatusOK, "Hello, World!")
    })

    e.Logger.Fatal(e.Start(":1323"))
}

터미널에서go run server.go 를 실행시켰더니 아래와 같이 에러가 났다.

go: inconsistent vendoring in C:\Go\src: github.com/labstack/echo/v4@v4.1.17: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
golang.org/x/crypto@v0.0.0-20200820211705-5c72a883971a: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
golang.org/x/crypto@v0.0.0-20200622213623-75b288015ac9: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
golang.org/x/sys@v0.0.0-20200501145240-bc7a7d42d5c3: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod
golang.org/x/text@v0.3.3-0.20200430171850-afb9336c4530: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod

run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory

물론 go get -u 를 했을 때

go get .: path C:\Go\src\echotest is not a package in module rooted at C:\Go\src;

프로젝트를 포함시켜야 하는데 안해서 나는 에러
go mod init "your-app-name" 

이름을 echotest 라고 했을 때

go mod init echotest

하고 나서 실행시키니 정상으로 서버가 가동 됨.

728x90
BLOG main image
"그게 뭐 어쨌다는 거냐?" 늘 누가 나에게 나에대한 말을할 때면 이말을 기억해라. by nobang

카테고리

nobang이야기 (1933)
Life With Gopro (7)
Life With Mini (79)
Diary (971)
너 그거 아니(do you know) (162)
난 그래 (159)
Study (290)
속지말자 (10)
Project (34)
Poem (15)
Song (0)
Photo (113)
낙서장 (45)
일정 (0)
C.A.P.i (2)
PodCast (0)
nobang (27)
고한친구들 (4)
recieve (0)
History (0)
android_app (2)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :