Gogo

Golang goland idea+golint+go fmt

2019-02-21  本文已影响68人  承诺一时的华丽

一、Go的相关插件工具简介

二、插件工具使用

1、golint

#下载源码
> go get github.com/golang/lint/
#编译包并生产可执行文件到bin目录下($GOPATH/bin)
> go install github.com/golang/lint/golint
Name : golint  #Tool名称
Description: golint  #Tool描述
Program : $GOPATH\bin\golint.exe #选择golint可执行文件的位置
Atguments: $FilePath$ #魔法变量(执行当前go文件的路径)
Working directory: $ProjectFileDir$ #魔法变量(当前项目的路径)

2、gofmt+goimports+gometalinter

3、go tool vet

> go tool vet global/init.go

测试结果


go vet
> go tool vet ../zlsc_image

测试结果

>go tool vet ../zlsc_image
..\zlsc_image\global\init.go:144: struct field c_ip has json tag but is not exported
..\zlsc_image\global\init.go:145: struct field college_id has json tag but is not exported
..\zlsc_image\global\init.go:146: struct field status has json tag but is not exported
..\zlsc_image\global\init.go:147: struct field camera_status has json tag but is not exported
..\zlsc_image\global\init.go:148: struct field sign_status has json tag but is not exported
..\zlsc_image\utils\file.go:160: Println call has possible formatting directive %s
..\zlsc_image\utils\file.go:172: Println call has possible formatting directive %s
..\zlsc_image\utils\file.go:184: Println call has possible formatting directive %s
..\zlsc_image\utils\image.go:89: unreachable code
..\zlsc_image\utils\image.go:79: image/jpeg.Options composite literal uses unkeyed fields
..\zlsc_image\utils\pic.go:388: unreachable code
..\zlsc_image\utils\uid.go:57: result of fmt.Sprintf call not used
..\zlsc_image\utils\uid.go:61: result of fmt.Sprintf call not used
..\zlsc_image\utils\uid.go:70: result of fmt.Sprintf call not used
..\zlsc_image\utils\uid.go:98: result of fmt.Sprintf call not used
..\zlsc_image\utils\convert\map.go:182: unreachable code
..\zlsc_image\utils\convert\map.go:196: unreachable code
..\zlsc_image\utils\convert\map.go:210: unreachable code
..\zlsc_image\utils\convert\map.go:224: unreachable code
上一篇 下一篇

猜你喜欢

热点阅读