Search code examples
gogo-gormgo-gin

'go mod init example.com/m' to initialize a v0 or v1 module


I am learning at https://youtu.be/ma7rUS_vW9M?t=73

Video

enter image description here

My environment

enter image description here

D:\temp2023_03_01\go\src>go version
go version go1.20.1 windows/amd64

My actions

Microsoft Windows [Version 10.0.22621.1265]
(c) Microsoft Corporation. All rights reserved.

D:\temp2023_03_01\go\src\github.com\robbyklein\go-jwt>go mod init
go: cannot determine module path for source directory D:\temp2023_03_01\go\src\github.com\robbyklein\go-jwt (outside GOPATH, module path must be specified)

Example usage:
        'go mod init example.com/m' to initialize a v0 or v1 module
        'go mod init example.com/m/v2' to initialize a v2 module

Run 'go help mod init' for more information.

D:\temp2023_03_01\go\src\github.com\robbyklein\go-jwt>

enter image description here

Why my result is different with video? What I do for archive result like the video?


Solution

  • D:\temp2023_03_01\go\src>go mod init github.com/robbyklein/go-jwt
    go: creating new go.mod: module github.com/robbyklein/go-jwt