Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go install support #46

Closed
ItsIgnacioPortal opened this issue Apr 13, 2022 · 3 comments
Closed

go install support #46

ItsIgnacioPortal opened this issue Apr 13, 2022 · 3 comments

Comments

@ItsIgnacioPortal
Copy link

Go get has been deprecated. Please update this repo to support go install

@gen2brain
Copy link
Owner

There is already support for Go modules, and there is nothing with main package that can be installed with go install. What support did you mean?

@ItsIgnacioPortal
Copy link
Author

I mean "beeep" can no longer be installed using "go get" as the readme describes. The project needs to support "go install".

Also, I haven't been able to use this project, not even manually. How do you import it? can you provide an example that actually works? 😅

@gen2brain
Copy link
Owner

Well, no, it does not need to support go install. You use that to install the binary in GOPATH/bin, when there is a binary, this is a library. Ignore the go get part, you don't need to install anything before, just go mod init your project, import the library, and use it.

# cat example.go 
package main

import "github.com/gen2brain/beeep"

func main() {
	err := beeep.Notify("Title", "Message body", "")
	if err != nil {
		panic(err)
	}
}


# go mod init example
go: creating new go.mod: module example
go: to add module requirements and sums:
	go mod tidy

# go mod tidy
go: finding module for package github.com/gen2brain/beeep
go: found github.com/gen2brain/beeep in github.com/gen2brain/beeep v0.0.0-20220402123239-6a3042f4b71a

# go build
# ./example

This is pretty much what you would use for any other library, nothing specific about this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants