Skip to content

Commit

Permalink
change loops to use indexing range
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingmar Wittkau authored and caalberts committed Oct 21, 2018
1 parent dd3ebb4 commit 0603cd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (rtr *router) updateSchema(schemas []types.Schema) {
rtr.Lock()
defer rtr.Unlock()
router := httprouter.New()
for i := 0; i < len(schemas); i++ {
for i := range schemas {
router.Handle(schemas[i].Method, schemas[i].Path, handlerFunc(schemas[i]))
}
rtr.Handler = router
Expand Down
2 changes: 1 addition & 1 deletion json/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (p *Parser) Watch(input chan io.Reader) {
func createSchema(stubs []stub) ([]types.Schema, error) {
schemas := make([]types.Schema, len(stubs))

for i := 0; i < len(stubs); i++ {
for i := range stubs {
if f := missingFields(stubs[i]); len(f) > 0 {
err := fmt.Errorf("missing required fields: %s", strings.Join(f, ", "))
return []types.Schema{}, err
Expand Down

0 comments on commit 0603cd3

Please sign in to comment.