fix: quickstart wrong package when go.mod exists in parent dir (#2048)
* chore: fix typo * fix: quickstart in dir with go.mod * fix: runner failed * chore: refine code * chore: simplify quickstart mono
This commit is contained in:
12
tools/goctl/pkg/golang/format.go
Normal file
12
tools/goctl/pkg/golang/format.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package golang
|
||||
|
||||
import goformat "go/format"
|
||||
|
||||
func FormatCode(code string) string {
|
||||
ret, err := goformat.Source([]byte(code))
|
||||
if err != nil {
|
||||
return code
|
||||
}
|
||||
|
||||
return string(ret)
|
||||
}
|
||||
Reference in New Issue
Block a user