#Go Get

69 messages ยท Page 1 of 1 (latest)

naive sigil
#

That is correct.

#

Either go install it, or initialize a module.

toxic lodge
#

Well how would I make it inside of a "module"

naive sigil
#

That is, if making a module is what you're trying to do ๐Ÿคท

toxic lodge
#

I'm trying to make a tool using discordgo, This will get loaded from a js file

#

Its gonna be inside of an app so it's not really a module

naive sigil
#

Yep yep, then you want to initialize a module for your app.

#

That's a "module" in Go parlance.

toxic lodge
#

Oh alright

#

Ill give that a shot then ๐Ÿ‘

naive sigil
#

Best of luck, and feel free to ask follow up questions ๐Ÿ™‚

toxic lodge
#

Maybe would like to stay here since I'm very new to go and I'm trying to learn it rn haha

#

As it's fast as I've decided it'll be more useful than js or py yk

naive sigil
#

Yeah, well, different tasks call for different tools. Client-side scripting for a website is not very elegant in Go ๐Ÿ˜‰

toxic lodge
#

I'm encorperating js, py & go it seems

#

๐Ÿ’€

#

@naive sigil Sorry for the mention, but at the moment I don't have a website and I don't plan on uploading my code to github publicly, where would I initialize my code to

It tells me to use go mod init githubrepo.com/modulename

quaint halo
#

you can use any identifier for the module name, it's commonly a repository URL so that it integrates nicely with go get etc

#

but you can do go mod init foobar, and then packages within your module would be imported with import foobar/baz

naive sigil
#

Yeah, I have several things on GitHub with non-githubbed module names.

#

Because I'm a filthy cheater.

toxic lodge
#

Im trying to import these modules

naive sigil
#

Did you go get them after initializing the module?

toxic lodge
#

Well will this work using this go mod init evo

naive sigil
#

Yes.

toxic lodge
quaint halo
#

module paths don't include a scheme

toxic lodge
#

Oh

#

Well I can't use mp3 then...

#

Odd

quaint halo
#

Sure, just use github.com/faiface/beep/mp3"

toxic lodge
quaint halo
#

It sure does ๐Ÿ™‚

toxic lodge
#

Not for me?

quaint halo
#

It's not (webpage), it's a URI for a go module. The repository is github.com/faiface/beep with the package path being /mp3

toxic lodge
#

yeah

quaint halo
#

so it won't load in a browser

toxic lodge
#

Go is quite slow

#

Like it takes a while to actually run this code

#

I'm using cmd prompt inside of github

#

It also took ages to get modules

naive sigil
#

You only need to get the modules once, and go run includes a build phase. When running it for real you'd only build it once, then run the resulting binary.

toxic lodge
#

Oh right

naive sigil
#

I'm not sure what here is slower than you expected?

toxic lodge
#

That makes sense now

toxic lodge
#

Didnt know about that part

quaint halo
#

Is this the online vscode editor from GitHub?

toxic lodge
#

Is there a way I can build and just test normally?

naive sigil
#

Just go build inside the module's directory.

#

It'll produce a binary. Run that.

toxic lodge
#

๐Ÿ’€

quaint halo
#

well you wont get any more help here for a project called nitro-sniper

naive sigil
#

hahaha, yeah, I was thinking the same thing.

toxic lodge
#

Ignore the project name

#

Thats not the main goal here

#

Im just tryna learn go

quaint halo
#

acc-spammer, dm-flooder, nitrro-sniper

naive sigil
#

What, so you can spam DMs?

quaint halo
#

learn go to do stuff that's worth while

toxic lodge
#

I can already do that with JS my friend

#

Im not going to.

#

Its just for educational purposes yk