Comments (5)
Hello, it's great to receive your inquiry. Regarding your question, I have the following two points to address:
-
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 implementedgo mod
, there is no need to use the outdatedgo get
. -
How to add this library as a dependency?
a. If you are usinggo 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 thego.mod
andgo.sum
files by using thego mod tidy
command.b. If you are not using
go mod
, then you need to usego get
to install all the relevant dependencies. This ensures that Golang can compile the files correctly.
您好,很高兴收到您的询问。 关于你的问题,我有以下两点需要解答:
-
如何使用
go mod
?
有关如何使用go mod
的信息,请参阅:https://go.dev/ref/mod。 一般来说,一旦我们实现了go mod
,就没有必要再使用过时的go get
了。 -
如何将此库添加为依赖项?
a. 如果您使用go mod
,则只需在 Go 代码中导入相关的包/模块即可。 Golang在编译程序时会自动加载相关依赖。 当然,您也可以使用go mod tidy
命令手动将相关依赖信息拉取到go.mod
和go.sum
文件中。
b. 如果您没有使用go mod
,那么您需要使用go get
安装所有相关依赖项。 这确保了 Golang 可以正确编译文件。
from socket.io.
@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.
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.
If you read the readme.md file, you will get more help.
如果您阅读 readme.md 文件,您将获得更多帮助。
from socket.io.
If there are no other questions I will close this issue.
from socket.io.
Related Issues (20)
- Benchmarking HOT 3
- Is *socket.Server Emit() safe for concurrent use? HOT 1
- Start https socket server HOT 1
- How to get the clients or one of them HOT 2
- Does this project have Discord or Telegram group? HOT 1
- Golang client HOT 6
- 如何实现回调功能 HOT 6
- ack 回调中的err参数具体是什么?有没有例子? HOT 8
- Possible to Ack incomming client EmitWithAck messages? HOT 1
- how to use on echo web freamwork HOT 2
- Nothing, absolutely nothing. works. Not even the default samples.
- Do you mind looking into Fiber adaptor for net/http interface to make this library work with fiber applications? HOT 6
- EmitwithAck never listens for the callback from the client so it always timed out HOT 6
- how to fetch /socket.io/socket.io.js ? HOT 4
- 请问socketio的reconnect机制到底啥玩意 HOT 6
- socket.io client question HOT 4
- 使用文档示例代码运行后用客户端无法连接 HOT 2
- How to get the server room HOT 6
- How to create a client on the server? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket.io.