MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / FormatGoCode

Function FormatGoCode

pkg/waveapputil/waveapputil.go:65–79  ·  view source on GitHub ↗
(contents []byte)

Source from the content-addressed store, hash-verified

63}
64
65func FormatGoCode(contents []byte) []byte {
66 gofmtPath, err := ResolveGoFmtPath()
67 if err != nil {
68 return contents
69 }
70
71 cmd := exec.Command(gofmtPath)
72 cmd.Stdin = bytes.NewReader(contents)
73 formattedOutput, err := cmd.Output()
74 if err != nil {
75 return contents
76 }
77
78 return formattedOutput
79}

Callers 2

WriteAppGoFileCommandMethod · 0.92

Calls 2

ResolveGoFmtPathFunction · 0.85
OutputMethod · 0.80

Tested by

no test coverage detected