Skip to content

Commit

Permalink
fix: Fixed the error when no function is declared under the namespace…
Browse files Browse the repository at this point in the history
… of the service (#831)
  • Loading branch information
abyss-w authored Sep 28, 2021
1 parent fd443c7 commit e80925d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/definitions/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ func (d *Data) LoadService(filePath string) {
// Append namespace itself into implement.
ns.Implement = append(ns.Implement, ns.Name+"r")

// When no function is declared under the namespace of the service, we should initialize the map `ns.Op`.
if ns.Op == nil {
ns.Op = make(map[string]*Function, 0)
}

// Handle features.
for _, featureName := range ns.Features {
f, ok := d.FeaturesMap[featureName]
Expand Down

0 comments on commit e80925d

Please sign in to comment.