Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mat Ryer authored and Mat Ryer committed Oct 31, 2014
1 parent b4494c1 commit 8159883
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
linefeed = "\r\n"
)
var unwantedLinePrefixes = [][]byte{
[]byte("//go:generate genny"),
[]byte("//go:generate genny "),
}

func generateSpecific(filename string, in io.ReadSeeker, typeSet map[string]string) ([]byte, error) {
Expand Down Expand Up @@ -177,12 +177,18 @@ func Generics(filename string, in io.ReadSeeker, typeSets []map[string]string) (
}

// check all unwantedLinePrefixes - and skip them
skipline := false
for _, prefix := range unwantedLinePrefixes {
if bytes.HasPrefix(scanner.Bytes(), prefix) {
skipline = true
continue
}
}

if skipline {
continue
}

cleanOutputLines = append(cleanOutputLines, line(scanner.Text()))
}

Expand Down

0 comments on commit 8159883

Please sign in to comment.