`go mod vendor` copies in the files as found in the repository. It does not normalize them according to your local .gitattributes.
(In fact, the `go` command intentionally ignores attribute-based transformations when downloading modules: see https://golang.org/issue/27153.) On Friday, January 31, 2020 at 9:40:31 AM UTC-5 sitback...@gmail.com wrote: > Hi, > > I am migrating a project to go modules. I have already moved everything to > the vendor folder and checked in the files. > After running go mod vendor on the clean working git tree, one of the > files from a dependency, runbench.cmd, appears to > be changed according to git. I am getting the following warning: > > warning: LF will be replaced by CRLF in vendor/ > github.com/klauspost/compress/snappy/runbench.cmd. > The file will have its original line endings in your working directory. > > In the repos gitattributes file *.cmd files configured to keep their > original line endings, CRLF: > *.cmd text eol=crlf > > It seems like go mod command does not take newlines into account when > downloading packages. > > Do you have any suggestion on how to fix this problem besides checking out > the file again or adding a special > rule to gitattributes for this file? > > I am using go 1.13.7 on linux/amd64. > > Thank you in advance! > > BR, > n > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/538cab50-52bf-4502-ab00-44123b2a2ef3%40googlegroups.com.