Merge pull request #7 from edjsu/flexible-comments
Allow comments to appear anywhere on a line in the auth file
This commit is contained in:
commit
0e43a20937
4
main.go
4
main.go
@ -43,8 +43,8 @@ func main() {
|
|||||||
|
|
||||||
lines := strings.Split(string(data[:size]), "\n")
|
lines := strings.Split(string(data[:size]), "\n")
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
if strings.HasPrefix(line, "#") {
|
if i := strings.IndexRune(line, '#'); i > -1 {
|
||||||
continue
|
line = line[:i]
|
||||||
}
|
}
|
||||||
fields := strings.Fields(line)
|
fields := strings.Fields(line)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user