Giter VIP home page Giter VIP logo

Comments (5)

zishang520 avatar zishang520 commented on September 22, 2024

Hello, it's great to receive your inquiry. Regarding your question, I have the following two points to address:

  1. How to use ·go mod?
    For information on how to use go.mod, please refer to: https://go.dev/ref/mod. Generally, once we have implemented go mod, there is no need to use the outdated go get.

  2. How to add this library as a dependency?
    a. If you are using go mod, you just need to import the relevant package/module in your Go code. Golang will automatically load the relevant dependencies when compiling the program. Of course, you can also manually pull relevant dependency information into the go.mod and go.sum files by using the go mod tidy command.

    b. If you are not using go mod, then you need to use go get to install all the relevant dependencies. This ensures that Golang can compile the files correctly.


您好,很高兴收到您的询问。 关于你的问题,我有以下两点需要解答:

  1. 如何使用 go mod
    有关如何使用 go mod 的信息,请参阅:https://go.dev/ref/mod。 一般来说,一旦我们实现了go mod,就没有必要再使用过时的go get了。

  2. 如何将此库添加为依赖项?
    a. 如果您使用 go mod,则只需在 Go 代码中导入相关的包/模块即可。 Golang在编译程序时会自动加载相关依赖。 当然,您也可以使用 go mod tidy 命令手动将相关依赖信息拉取到 go.modgo.sum 文件中。
    b. 如果您没有使用 go mod,那么您需要使用 go get 安装所有相关依赖项。 这确保了 Golang 可以正确编译文件。

from socket.io.

vipcxj avatar vipcxj commented on September 22, 2024

@zishang520 我发现问题所在了~
我在 https://pkg.go.dev/ 上搜到了你的库,然后发现你这库的完整名字应该是这个:

socket (github.com/zishang520/socket.io/v2/socket)

然后我是用

go get github.com/zishang520/socket.io/v2/socket

(注意末尾这个socket)
这次就正常了,间接依赖也正常一起加上了

虽然或许像你说的可以不用go get,但这个小问题确实会让库的使用者很迷惑~

from socket.io.

zishang520 avatar zishang520 commented on September 22, 2024

Yes, you are right. There is no information in the root directory. For better readability and maintainability, the package has been divided into various subdirectories.


是的,你是对的。 根目录下没有任何信息。 为了更好的可读性和可维护性,该包已分为各个子目录。

from socket.io.

zishang520 avatar zishang520 commented on September 22, 2024

If you read the readme.md file, you will get more help.


如果您阅读 readme.md 文件,您将获得更多帮助。

from socket.io.

zishang520 avatar zishang520 commented on September 22, 2024

If there are no other questions I will close this issue.

from socket.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.