MCPcopy Index your code
hub / github.com/nikivdev/go / save

Method save

workspace.go:170–181  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

168}
169
170func (w *workspaceDocument) save(path string) error {
171 content, err := json.MarshalIndent(w, "", " ")
172 if err != nil {
173 return err
174 }
175
176 mode := fs.FileMode(0o644)
177 if info, statErr := os.Stat(path); statErr == nil {
178 mode = info.Mode().Perm()
179 }
180 return os.WriteFile(path, content, mode)
181}
182
183func (w *workspaceDocument) list(kind workspaceList) []string {
184 switch kind {

Callers 2

workspaceAddPathFunction · 0.45
workspaceRemovePathFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected