Skip to content

Commit

Permalink
return nil instead of empty map (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsinger-klotho authored Dec 21, 2022
1 parent 9ef83c5 commit 25449d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/annotation/directive.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (d Directives) Int(key string) (int, bool) {
func (d Directives) Object(key string) Directives {
v, ok := d[key]
if !ok {
return make(Directives)
return nil
}
m, ok := v.(map[string]interface{})
if !ok {
Expand Down
7 changes: 3 additions & 4 deletions pkg/lang/javascript/plugin_persist.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,11 @@ func (p *persister) handleFile(f *core.SourceFile, unit *core.ExecutionUnit) ([]
continue
}

if annot.Capability.Directives.Object(core.EnvironmentVariableDirective) != nil {
continue
}

keyType, pResult := p.determinePersistType(f, annot)
if pResult == nil {
if annot.Capability.Directives.Object(core.EnvironmentVariableDirective) != nil {
continue
}
log.Warn("Could not determine persist type")
continue
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/lang/python/plugin_persist.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ func (p *persister) handleFile(f *core.SourceFile, unit *core.ExecutionUnit) ([]
continue
}

if annot.Capability.Directives.Object(core.EnvironmentVariableDirective) != nil {
continue
}

keyType, pResult := p.determinePersistType(f, annot)
if pResult == nil {
if annot.Capability.Directives.Object(core.EnvironmentVariableDirective) != nil {
continue
}
log.Warn("Could not determine persist type")
continue
}
Expand Down

0 comments on commit 25449d6

Please sign in to comment.