MCPcopy Index your code
hub / github.com/dagger/dagger / Load

Method Load

cmd/dagger/shell_state.go:114–125  ·  view source on GitHub ↗

Load is like [Get] but returns an error if the key is not found or if the state represents an error.

(key string)

Source from the content-addressed store, hash-verified

112// Load is like [Get] but returns an error if the key is not found or if
113// the state represents an error.
114func (s *ShellStateStore) Load(key string) (*ShellState, error) {
115 if key == "" {
116 return nil, nil
117 }
118 st, exists := s.Get(key)
119 if !exists {
120 return nil, fmt.Errorf("tried to access non-existent state %q", key)
121 }
122 cp := st
123 cp.Calls = slices.Clone(st.Calls)
124 return &cp, cp.Error
125}
126
127// Extract is like [Load] but also deletes the state from memory.
128//

Callers 1

ExtractMethod · 0.95

Calls 2

GetMethod · 0.95
CloneMethod · 0.65

Tested by

no test coverage detected