Skip to content

Commit

Permalink
Fix some linting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
brandur committed Jun 23, 2017
1 parent 72c4df8 commit d3b8774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ import (
var errExpansionNotSupported = fmt.Errorf("Expansion not supported")
var errNotSupported = fmt.Errorf("Expected response to be a list or include $ref")

// DataGenerator generates fixture response data based off a response schema, a
// set of definitions, and a fixture store.
type DataGenerator struct {
definitions map[string]*JSONSchema
fixtures *Fixtures
}

// Generate generates a fixture response.
func (g *DataGenerator) Generate(schema *JSONSchema, requestPath string, expansions *ExpansionLevel) (interface{}, error) {
return g.generateInternal(schema, requestPath, expansions, nil)
}
Expand All @@ -26,7 +29,7 @@ func (g *DataGenerator) generateInternal(schema *JSONSchema, requestPath string,

// Determine if the requested expansions are possible
if expansions != nil {
for key, _ := range expansions.expansions {
for key := range expansions.expansions {
if sort.SearchStrings(schema.XExpandableFields, key) ==
len(schema.XExpandableFields) {
return nil, errExpansionNotSupported
Expand Down
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ExpansionLevel struct {
wildcard bool
}

// ParseExpasionLevel parses a set of raw expansions from a request query
// ParseExpansionLevel parses a set of raw expansions from a request query
// string or form and produces a structure more useful for performing actual
// expansions.
func ParseExpansionLevel(raw []string) *ExpansionLevel {
Expand Down Expand Up @@ -65,6 +65,7 @@ type stubServerRoute struct {
method *OpenAPIMethod
}

// HandleRequest handes an HTTP request directed at the API stub.
func (s *StubServer) HandleRequest(w http.ResponseWriter, r *http.Request) {
log.Printf("Request: %v %v", r.Method, r.URL.Path)
start := time.Now()
Expand Down

0 comments on commit d3b8774

Please sign in to comment.