tinylib / msgp

A Go code generator for MessagePack / msgpack.org[Go]
MIT License
1.77k stars 189 forks source link

gofmt code for current go versions, and some minor fixes #318

Closed thaJeztah closed 1 year ago

thaJeztah commented 1 year ago

supersedes / closes https://github.com/tinylib/msgp/pull/234

gofmt for current versions of go and remove stray whitespace

gofmt the code for current versions of go:

also remove stray whitespace to make more linters happy.

before:

Screenshot 2022-12-11 at 15 15 53

after:

Screenshot 2022-12-11 at 15 16 12

fix some godoc comments, and add docs links

Use the "docs links" ([<reference>]) format so that the documentation generates links to the types referenced.

With this patch:

Screenshot 2022-12-11 at 15 25 09

gofumpt code

Format the code with "gofumpt" (https://github.com/mvdan/gofumpt), which provides a superset of go's default gofmt with some slightly more opinionated formatting rules (but making more linters happy).

Also updated one string to use a string-literal for readability.

:warning: for reviewers; happy to either drop this commit (if not desirable or to squash it with the "gofmt" commit).

replace deprecated os.SEEK_SET for io.SeekStart

These consts deprecated in https://go-review.googlesource.com/21540 (go1.7) in favor of the consts defined in io.

go.mod: update go version to 1.15 to match what's tested

CI tests against go1.15 as minimum version, so update the go.mod to reflect that. Older versions of Go should still be able to use the module, as it's not enforced (mostly an indicator as the known minimum compatible version).

README: update link to docs website, and add docs reference badge

godoc.org moved to pkg.go.dev, so updating the link; while updating the file also added a badge to link to the module's reference on pkg.go.dev.

thaJeztah commented 1 year ago

@philhofer Alright; this one has been rebased, and CI is happy 🎉

thaJeztah commented 1 year ago

@philhofer ptal 🤗

thaJeztah commented 1 year ago

@philhofer thanks! Do you know if there's plans for a new tag / release?

philhofer commented 1 year ago

Sure, happy to do that.

thaJeztah commented 1 year ago

Thanks! And enjoy your NYE! ❤️