Go fmt on a whole source tree

前端 未结 6 892
借酒劲吻你
借酒劲吻你 2021-01-30 03:36

I have a project currently organized something like this:

~/code/go
         /bin
         /pkg
         /src
             /proj/main.go
                  /some_packa         


        
6条回答
  •  孤街浪徒
    2021-01-30 04:26

    The command gofmt ./... mentioned by some, does not work on Windows (at least on my Win7).

    Instead of it, I used gofmt -d .\ which works recursively. I use the -d flag because I want to list the changes I need to make in order to pass the check.

    NB: golint ./... does work on Windows, just gofmt ./... doesn't.

提交回复
热议问题