MCPcopy
hub / github.com/swaggo/swag / Run

Method Run

format/format.go:136–150  ·  view source on GitHub ↗

Run the format on src and write the result to dst.

(src io.Reader, dst io.Writer)

Source from the content-addressed store, hash-verified

134
135// Run the format on src and write the result to dst.
136func (f *Format) Run(src io.Reader, dst io.Writer) error {
137 contents, err := io.ReadAll(src)
138 if err != nil {
139 return err
140 }
141 result, err := f.formatter.Format("", contents)
142 if err != nil {
143 return err
144 }
145 r := bytes.NewReader(result)
146 if _, err := io.Copy(dst, r); err != nil {
147 return err
148 }
149 return nil
150}

Callers 15

Test_splitComment2Function · 0.80
TestListPackagesFunction · 0.80
TestSpec_InstanceNameFunction · 0.80
TestSpec_ReadDocFunction · 0.80
TestFieldsByAnySpaceFunction · 0.80
TestAppendDescriptionFunction · 0.80
TestNewFunction · 0.80

Calls 1

FormatMethod · 0.80

Tested by 15

Test_splitComment2Function · 0.64
TestListPackagesFunction · 0.64
TestSpec_InstanceNameFunction · 0.64
TestSpec_ReadDocFunction · 0.64
TestFieldsByAnySpaceFunction · 0.64
TestAppendDescriptionFunction · 0.64
TestNewFunction · 0.64