ini: change minimum Go requirement to 1.6

This commit is contained in:
Unknwon
2018-07-11 20:55:23 +08:00
parent cec2bdc490
commit fa6ee696e4
3 changed files with 3 additions and 3 deletions
-1
View File
@@ -1,7 +1,6 @@
sudo: false
language: go
go:
- 1.5.x
- 1.6.x
- 1.7.x
- 1.8.x
+2
View File
@@ -1,3 +1,5 @@
// +build go1.6
// Copyright 2014 Unknwon
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
+1 -2
View File
@@ -390,8 +390,7 @@ func (f *File) parse(reader io.Reader) (err error) {
// Section
if line[0] == '[' {
// Read to the next ']' (TODO: support quoted strings)
// TODO(unknwon): use LastIndexByte when stop supporting Go1.4
closeIdx := bytes.LastIndex(line, []byte("]"))
closeIdx := bytes.LastIndexByte(line, ']')
if closeIdx == -1 {
return fmt.Errorf("unclosed section: %s", line)
}