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

Rename package from libstone to libstone-go #3

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

livingsilver94
Copy link
Collaborator

@livingsilver94 livingsilver94 commented Feb 20, 2024

@der-eismann you were right, it's better to reflect the URL in the package name, otherwise pkg.go.dev won't find our library.

Furthermore, Go removes the go- prefix from package names, and the -go suffix, so it's all good.

@der-eismann
Copy link
Member

Maybe we should prefix it instead then? Works for this hashicorp project as well.

@livingsilver94
Copy link
Collaborator Author

livingsilver94 commented Feb 20, 2024

See my edit. -go suffix is accepted as well. After all, our own code calls libstone.*. See https://github.com/serpent-os/libstone-go/blob/reponame-test/internal/cli/inspect.go#L26 as an example

@der-eismann
Copy link
Member

Ah that's what you mean, I thought you were talking about pkg.go.dev, sorry. Fine for me!

@livingsilver94
Copy link
Collaborator Author

I was talking about both actually :) it looks like I'm making a mess at explaining myself, so here's a recap

  1. pkg.go.dev expect the module name to reflect the URL, so we must name the package github.com/serpent-os/libstone-go
  2. Go removes go- prefix and -go suffix in code, so that we can just write libstone.* in code without that annoying dash and the redundant "go" string. We are writing Go, we don't need to remind ourselves it's Go :)

@livingsilver94 livingsilver94 merged commit a97afc1 into main Feb 20, 2024
2 checks passed
@livingsilver94 livingsilver94 deleted the reponame-test branch February 20, 2024 15:26
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

Successfully merging this pull request may close these issues.

2 participants