1. 55
  1. 12

    I grew tired of always looking up the magic invocation to add, remove, upgrade dependencies, so I assembled all the concepts you need to know to use Go modules effectively on a single page. Hopefully it’s helpful to others.

    1. 3

      You did a great job at keeping it brief while still being usable.

      Thanks!

    2. 8

      Kudos on a cheat sheet that’s small and clear enough to actually be a cheat sheet! Very nicely done!

      1. 1

        Thank you, that was the idea!

      2. 4

        Thank you for this! I totally missed out the transition, because I have an older version of Go installed, and now it seems that it’s assumed knowledge.

        1. 4

          Great list. I would add:

          go clean -modcache
          

          for the occasional need to do spring cleaning.

          1. 2

            this is concise and thus so very nice

            1. 2

              If I could make a recommendation: some information on Git tags would be helpful. Thanks for the cheat sheet.

              1. 2

                I love it! What did you use to create the svg annotations?

                1. 1

                  Thanks! I used Illustrator and then spent an hour cleaning it up by hand :)

                2. 1

                  Never used -d and I think it can be omitted, e.g. from go get -d -u ./... or go get -d github.com/path/to/module. This is what go help get says:

                  The -d flag instructs get not to build or install packages. get will only update go.mod and download source code needed to build packages.

                  Building and installing packages with get is deprecated. In a future release, the -d flag will be enabled by default, and ‘go get’ will be only be used to adjust dependencies of the current module. To install a package using dependencies from the current module, use ‘go install’. To install a package ignoring the current module, use ‘go install’ with an @version suffix like “@latest” after each argument.