Skip to content

Commit

Permalink
Fixes go vet's complaints that graphql.Schema is passing Lock by …
Browse files Browse the repository at this point in the history
…value
  • Loading branch information
sogko committed Jun 11, 2016
1 parent ca2d6d8 commit f7aec0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Schema struct {
possibleTypeMap map[string]map[string]bool

// mutex lock for possibleTypeMap that is accessed by multiple routines in executor through IsPossibleType()
typeMapMutex sync.RWMutex
typeMapMutex *sync.RWMutex
}

func NewSchema(config SchemaConfig) (Schema, error) {
Expand All @@ -45,7 +45,7 @@ func NewSchema(config SchemaConfig) (Schema, error) {
schema := Schema{
implementations: map[string][]*Object{},
possibleTypeMap: map[string]map[string]bool{},
typeMapMutex: sync.RWMutex{},
typeMapMutex: &sync.RWMutex{},
}

err = invariant(config.Query != nil, "Schema query must be Object Type but got: nil.")
Expand Down

0 comments on commit f7aec0f

Please sign in to comment.