MCPcopy Index your code
hub / github.com/go-task/task / Read

Method Read

taskrc/reader.go:60–79  ·  view source on GitHub ↗

Read will read the Task config defined by the [Reader]'s [Node].

(node *Node)

Source from the content-addressed store, hash-verified

58
59// Read will read the Task config defined by the [Reader]'s [Node].
60func (r *Reader) Read(node *Node) (*ast.TaskRC, error) {
61 var config ast.TaskRC
62
63 if node == nil {
64 return nil, os.ErrInvalid
65 }
66
67 // Read the file
68 b, err := os.ReadFile(node.entrypoint) //nolint:gosec
69 if err != nil {
70 return nil, err
71 }
72
73 // Parse the content
74 if err := yaml.Unmarshal(b, &config); err != nil {
75 return nil, err
76 }
77
78 return &config, nil
79}

Callers 2

readTaskfileMethod · 0.95
GetConfigFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected