Home >Backend Development >Golang >'go mod init example.com/m' initialize v0 or v1 module

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

王林
王林forward
2024-02-13 17:50:08637browse

\'go mod init example.com/m\' 初始化 v0 或 v1 模块

php editor Xiaoxin will introduce to you a simple and practical command-'go mod init example.com/m'. This command is used to initialize a v0 or v1 module, which can help developers quickly create and manage their own Go projects. By using this command, developers can easily start a new project and can easily introduce and manage dependencies. Whether you are a beginner or an experienced developer, you can improve development efficiency and better organize and manage your projects by using this command.

Question content

I am studying at https://youtu.be/ma7rus_vw9m?t=73

video

My environment

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

My Action

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>

Why are my results different from the video? What do I do with archived results like videos?

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

The above is the detailed content of 'go mod init example.com/m' initialize v0 or v1 module. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete