ArtalkJS / Artalk

🌌 Your Self-hosted Comment System. | 自托管评论系统
https://artalk.js.org
MIT License
1.67k stars 142 forks source link

refactor(go): bump the module version and support `go install` #979

Closed qwqcode closed 1 month ago

qwqcode commented 1 month ago

BREAKING CHANGE: The original Go module name was github.com/ArtalkJS/Artalk, but it has now been updated to github.com/ArtalkJS/Artalk/v2. This modification may impact the CI if you're compiling Artalk and passing a -ldflags -X version flag. The frontend UI client remains unaffected, and this change only concerns server-side developers.

Follow Go Mod File Retract:

If a module is released at major version v2 or higher, its path must have a major version suffix. A module with a major version suffix may be defined in one of two subdirectories: one with the suffix, and one without. For example, suppose a new version of the module above is released with the path example.com/monorepo/foo/bar/v2. Its go.mod file may be in either foo/bar or foo/bar/v2.

https://go.dev/ref/mod#go-mod-file-retract

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 32.16%. Comparing base (a98a50a) to head (df26393). Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
internal/config/meta/gen/main.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #979 +/- ## ======================================= Coverage 32.16% 32.16% ======================================= Files 205 205 Lines 6842 6842 ======================================= Hits 2201 2201 Misses 4487 4487 Partials 154 154 ``` | [Flag](https://app.codecov.io/gh/ArtalkJS/Artalk/pull/979/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ArtalkJS) | Coverage Δ | | |---|---|---| | [go](https://app.codecov.io/gh/ArtalkJS/Artalk/pull/979/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ArtalkJS) | `32.16% <0.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ArtalkJS#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

qwqcode commented 1 month ago

Since the binary file name after go install must match the module name, the module name had to be changed to all lowercase. This ensures that the artalk command can be found in the command line (rather than using the capitalized Artalk as the binary program name).

https://github.com/golang/go/issues/44469