MCPcopy Create free account
hub / github.com/MG-RAST/Shock / SetAttributes

Method SetAttributes

shock-server/node/node.go:385–396  ·  view source on GitHub ↗
(attr file.FormFile)

Source from the content-addressed store, hash-verified

383}
384
385func (node *Node) SetAttributes(attr file.FormFile) (err error) {
386 defer attr.Remove()
387 attributes, err := ioutil.ReadFile(attr.Path)
388 if err != nil {
389 return
390 }
391 err = json.Unmarshal(attributes, &node.Attributes)
392 if err != nil {
393 return
394 }
395 return
396}
397
398func (node *Node) SetAttributesFromString(attributes string) (err error) {
399 err = json.Unmarshal([]byte(attributes), &node.Attributes)

Callers 1

UpdateMethod · 0.95

Calls 1

RemoveMethod · 0.45

Tested by

no test coverage detected