Skip to content

Commit

Permalink
Modified .gitattributes to fix Go's overly aggresive go.mod changes.
Browse files Browse the repository at this point in the history
It seems that the Go toolchain wants to normalize go.mod's line endings
even if there are no changes to the file (golang/go#31870). This
normalization is disallowed by the -mod=readonly build flag, causing
builds to fail. This is likely fixed by golang/go@cf3be9b, but that
won't land until Go 1.14, and in any event the line ending normalization
will still occur if there are changes to go.mod/go.sum generated on
Windows.

Signed-off-by: Jacob Howard <[email protected]>
  • Loading branch information
xenoscopic committed Dec 2, 2019
1 parent 5c8cf41 commit f1eb308
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Automatically normalize line endings to \n when checking in text files.
* text=auto

# Enforce that Go module metadata files are always checked out with newline
# endings, because Go will try to normalize them to newline line endings even if
# there are no changes, which will cause builds to fail on Windows if the
# -mod=readonly flag is specified to go build.
go.mod text eol=lf
go.sum text eol=lf

0 comments on commit f1eb308

Please sign in to comment.