Skip to content

Proposal: rename module and package #2

Closed

Description

@myitcv

Firstly, thank you very much for starting this project. Your blog post inspired me to try and take the idea further:

https://blog.myitcv.io/2020/02/04/portable-ci-cd-with-pure-go-github-actions.html

I wonder, however, whether in these v0 days we should consider a different module path and package name:

github.com/sethvargo/go-githubactions has the disadvantage that:

  • the base of the import path does not match the package name
  • the package name, githubactions, is rather long

Options we have:

  1. Change the module (and package) path to github.com/sethvargo/actions
  2. Switch to a vanity URL (so that the backing VCS repo can be named whatever we like): sethvargo.com/actions

Thoughts?

Activity

  1. sethvargo commented on Feb 6, 2020

    @sethvargo
    Owner

    I'm a fan of descriptive package names.

    1. Go automatically handles the go- prefix, so the package name is just githubactions - this is quite common in the Go ecosystem

    2. actions is really generic and will likely conflict with other things in any real-world use

    3. You can always alias it yourself:

      import (
        actions "github.com/sethvargo/go-githubactions"
      )
    4. I don't like vanity URLs because it makes it hard for users to find the true source of truth

    Thank you for the feedback, but I'm going to keep it as-is 😄

  2. myitcv commented on Feb 6, 2020

    @myitcv
    ContributorAuthor

    Thanks for taking the time to respond.

    I'm a fan of descriptive package names.

    Indeed, but I think there is something to be said for the import path also conveying meaning/scope too. So I would find:

    github.com/sethvargo/github/actions
    

    preferable for example.

    As I understand it, people use a go- prefix for the base of the import path as a means of easily distinguishing between Go and non-Go repositories in your VCS (GitHub) and in, say, Google search results: is that true here?

    Vanity import paths are, to my mind, cleaner: because they abstract away from where code is stored/maintained. Tools and sites like https://pkg.go.dev could and should, I agree, make it easier to quickly navigate from import path to source location. I also have hopes that pkg.go.dev will improve things on the discoverability front too.

    1. actions is really generic and will likely conflict with other things in any real-world use

    I think the context is important here because it's more a question of whether we are likely to use another package called actions in the course of writing a GitHub action in Go.

    And if there were a clash, then an import path like:

    github.com/sethvargo/github/actions
    

    would at least allow us to alias one of the packages to another name and still know exactly which package we are referring to in either case.

    FWIW, https://godoc.org/?q=actions shows 18 packages named actions (I used godoc here because partial matching in pkg.go.dev is still not 100%: golang/go#36806)

    1. You can always alias it yourself:
      import (
        actions "github.com/sethvargo/go-githubactions"
      )

    Yes, I was aware of this - thanks.

    1. I don't like vanity URLs because it makes it hard for users to find the true source of truth

    Per above, I think pkg.go.dev (and other such tools) should improve things on the discoverability front: the package name is one element that contributes to a hit score, just as the remainder of the import path and documentation convey details too.

    Thank you for the feedback, but I'm going to keep it as-is 😄

    I appreciate the exchange in any case, thank you.

  3. mvdan commented on Feb 6, 2020

    @mvdan

    Just as a data point, we have packages like text/template, and it's OK that the name is a bit ambiguous. One can always do import texttemplate "text/template" if they happen to import lots of templating packages in the same file.

  4. github-actions commented on Aug 19, 2020

    @github-actions

    This issue has been automatically locked since there has not been any
    recent activity after it was closed. Please open a new issue for
    related bugs.

  5. locked as resolved and limited conversation to collaborators on Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions