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

Function loadWorkspaceFile

workspace.go:157–168  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

155}
156
157func loadWorkspaceFile(path string) (*workspaceDocument, error) {
158 data, err := os.ReadFile(path)
159 if err != nil {
160 return nil, err
161 }
162
163 var doc workspaceDocument
164 if err := json.Unmarshal(data, &doc); err != nil {
165 return nil, fmt.Errorf("parse workspace file: %w", err)
166 }
167 return &doc, nil
168}
169
170func (w *workspaceDocument) save(path string) error {
171 content, err := json.MarshalIndent(w, "", " ")

Callers 1

workspacePathsCmdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected