MCPcopy Index your code
hub / github.com/rilldata/rill / insertDryRun

Method insertDryRun

runtime/parser/parser.go:843–850  ·  view source on GitHub ↗

insertDryRun returns an error if calling insertResource with the given resource name would fail.

(kind ResourceKind, name string)

Source from the content-addressed store, hash-verified

841
842// insertDryRun returns an error if calling insertResource with the given resource name would fail.
843func (p *Parser) insertDryRun(kind ResourceKind, name string) error {
844 rn := ResourceName{Kind: kind, Name: name}
845 _, ok := p.Resources[rn.Normalized()]
846 if ok {
847 return externalError{err: fmt.Errorf("name collision: another resource of type %q is also named %q", rn.Kind, rn.Name)}
848 }
849 return nil
850}
851
852// insertResource inserts a resource in the parser's internal state.
853// After calling insertResource, the caller can directly modify the returned resource's spec.

Callers 2

Calls 2

NormalizedMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected