From a24711ff264806a7a801de45742b3dc5d796d0e6 Mon Sep 17 00:00:00 2001 From: Roger Peppe Date: Mon, 15 Jul 2019 18:23:16 +0100 Subject: [PATCH] remove import comments The import comments prevent the Go module compatibility code from working, because they stop the module being imported as its correct import path, `github.com/tdewolff/parse/v2`. The `go.mod` file supercedes the need for import comments now anyway. --- buffer/buffer.go | 2 +- buffer/lexer.go | 2 +- buffer/lexer_test.go | 2 +- buffer/reader.go | 2 +- buffer/reader_test.go | 2 +- buffer/streamlexer.go | 2 +- buffer/streamlexer_test.go | 2 +- buffer/writer.go | 2 +- buffer/writer_test.go | 2 +- common.go | 2 +- common_test.go | 2 +- css/hash_test.go | 2 +- css/lex.go | 2 +- css/lex_test.go | 2 +- css/parse.go | 2 +- css/parse_test.go | 2 +- css/util.go | 2 +- css/util_test.go | 2 +- html/hash_test.go | 2 +- html/lex.go | 2 +- html/lex_test.go | 2 +- html/util.go | 2 +- html/util_test.go | 2 +- js/hash_test.go | 2 +- js/lex.go | 2 +- js/lex_test.go | 2 +- json/parse.go | 2 +- json/parse_test.go | 2 +- strconv/float.go | 2 +- strconv/float_test.go | 2 +- strconv/int.go | 2 +- strconv/int_test.go | 2 +- strconv/price_test.go | 2 +- svg/hash_test.go | 2 +- util.go | 2 +- util_test.go | 2 +- xml/lex.go | 2 +- xml/lex_test.go | 2 +- xml/util.go | 2 +- xml/util_test.go | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/buffer/buffer.go b/buffer/buffer.go index 3094aa9..d9e14d1 100644 --- a/buffer/buffer.go +++ b/buffer/buffer.go @@ -5,7 +5,7 @@ The `Reader` and `Writer` types implement the `io.Reader` and `io.Writer` respec The `Lexer` type is useful for building lexers because it keeps track of the start and end position of a byte selection, and shifts the bytes whenever a valid token is found. The `StreamLexer` does the same, but keeps a buffer pool so that it reads a limited amount at a time, allowing to parse from streaming sources. */ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer // defaultBufSize specifies the default initial length of internal buffers. var defaultBufSize = 4096 diff --git a/buffer/lexer.go b/buffer/lexer.go index c25943d..d2909d0 100644 --- a/buffer/lexer.go +++ b/buffer/lexer.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import ( "io" diff --git a/buffer/lexer_test.go b/buffer/lexer_test.go index 4061899..97a5b71 100644 --- a/buffer/lexer_test.go +++ b/buffer/lexer_test.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import ( "bytes" diff --git a/buffer/reader.go b/buffer/reader.go index f1a0925..9926eef 100644 --- a/buffer/reader.go +++ b/buffer/reader.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import "io" diff --git a/buffer/reader_test.go b/buffer/reader_test.go index fb8631f..9c6950f 100644 --- a/buffer/reader_test.go +++ b/buffer/reader_test.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import ( "bytes" diff --git a/buffer/streamlexer.go b/buffer/streamlexer.go index 3ed3282..5ea2dd5 100644 --- a/buffer/streamlexer.go +++ b/buffer/streamlexer.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import ( "io" diff --git a/buffer/streamlexer_test.go b/buffer/streamlexer_test.go index d37b0c1..29ca8f9 100644 --- a/buffer/streamlexer_test.go +++ b/buffer/streamlexer_test.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import ( "bytes" diff --git a/buffer/writer.go b/buffer/writer.go index ded2f36..b3c9990 100644 --- a/buffer/writer.go +++ b/buffer/writer.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer // Writer implements an io.Writer over a byte slice. type Writer struct { diff --git a/buffer/writer_test.go b/buffer/writer_test.go index f56f5f7..0007f90 100644 --- a/buffer/writer_test.go +++ b/buffer/writer_test.go @@ -1,4 +1,4 @@ -package buffer // import "github.com/tdewolff/parse/buffer" +package buffer import ( "fmt" diff --git a/common.go b/common.go index 3b7158e..4c4aee9 100644 --- a/common.go +++ b/common.go @@ -1,5 +1,5 @@ // Package parse contains a collection of parsers for various formats in its subpackages. -package parse // import "github.com/tdewolff/parse" +package parse import ( "bytes" diff --git a/common_test.go b/common_test.go index a3dbcf4..4852fd1 100644 --- a/common_test.go +++ b/common_test.go @@ -1,4 +1,4 @@ -package parse // import "github.com/tdewolff/parse" +package parse import ( "encoding/base64" diff --git a/css/hash_test.go b/css/hash_test.go index e176cc1..0144aaf 100644 --- a/css/hash_test.go +++ b/css/hash_test.go @@ -1,4 +1,4 @@ -package css // import "github.com/tdewolff/parse/css" +package css import ( "testing" diff --git a/css/lex.go b/css/lex.go index 854ee9e..b275bab 100644 --- a/css/lex.go +++ b/css/lex.go @@ -1,5 +1,5 @@ // Package css is a CSS3 lexer and parser following the specifications at http://www.w3.org/TR/css-syntax-3/. -package css // import "github.com/tdewolff/parse/css" +package css // TODO: \uFFFD replacement character for NULL bytes in strings for example, or atleast don't end the string early diff --git a/css/lex_test.go b/css/lex_test.go index e351602..1c4bc92 100644 --- a/css/lex_test.go +++ b/css/lex_test.go @@ -1,4 +1,4 @@ -package css // import "github.com/tdewolff/parse/css" +package css import ( "bytes" diff --git a/css/parse.go b/css/parse.go index 92fb0fb..a6623cf 100644 --- a/css/parse.go +++ b/css/parse.go @@ -1,4 +1,4 @@ -package css // import "github.com/tdewolff/parse/css" +package css import ( "bytes" diff --git a/css/parse_test.go b/css/parse_test.go index adbdc7f..4050e03 100644 --- a/css/parse_test.go +++ b/css/parse_test.go @@ -1,4 +1,4 @@ -package css // import "github.com/tdewolff/parse/css" +package css import ( "bytes" diff --git a/css/util.go b/css/util.go index 25477b3..e20c499 100644 --- a/css/util.go +++ b/css/util.go @@ -1,4 +1,4 @@ -package css // import "github.com/tdewolff/parse/css" +package css import "github.com/tdewolff/parse/v2/buffer" diff --git a/css/util_test.go b/css/util_test.go index 9eb5aa9..1971ed5 100644 --- a/css/util_test.go +++ b/css/util_test.go @@ -1,4 +1,4 @@ -package css // import "github.com/tdewolff/parse/css" +package css import ( "testing" diff --git a/html/hash_test.go b/html/hash_test.go index c905ba3..ee9f420 100644 --- a/html/hash_test.go +++ b/html/hash_test.go @@ -1,4 +1,4 @@ -package html // import "github.com/tdewolff/parse/html" +package html import ( "bytes" diff --git a/html/lex.go b/html/lex.go index 566e282..4845b39 100644 --- a/html/lex.go +++ b/html/lex.go @@ -1,5 +1,5 @@ // Package html is an HTML5 lexer following the specifications at http://www.w3.org/TR/html5/syntax.html. -package html // import "github.com/tdewolff/parse/html" +package html import ( "io" diff --git a/html/lex_test.go b/html/lex_test.go index 2c8781f..c5d8e76 100644 --- a/html/lex_test.go +++ b/html/lex_test.go @@ -1,4 +1,4 @@ -package html // import "github.com/tdewolff/parse/html" +package html import ( "bytes" diff --git a/html/util.go b/html/util.go index 3e3fe39..fae46e7 100644 --- a/html/util.go +++ b/html/util.go @@ -1,4 +1,4 @@ -package html // import "github.com/tdewolff/parse/html" +package html import "github.com/tdewolff/parse/v2" diff --git a/html/util_test.go b/html/util_test.go index 698b254..b53baec 100644 --- a/html/util_test.go +++ b/html/util_test.go @@ -1,4 +1,4 @@ -package html // import "github.com/tdewolff/parse/html" +package html import ( "testing" diff --git a/js/hash_test.go b/js/hash_test.go index fa6a213..d6ed588 100644 --- a/js/hash_test.go +++ b/js/hash_test.go @@ -1,4 +1,4 @@ -package js // import "github.com/tdewolff/parse/js" +package js import ( "testing" diff --git a/js/lex.go b/js/lex.go index 042ee8e..10227f9 100644 --- a/js/lex.go +++ b/js/lex.go @@ -1,5 +1,5 @@ // Package js is an ECMAScript5.1 lexer following the specifications at http://www.ecma-international.org/ecma-262/5.1/. -package js // import "github.com/tdewolff/parse/js" +package js import ( "io" diff --git a/js/lex_test.go b/js/lex_test.go index f99a644..bce0ed4 100644 --- a/js/lex_test.go +++ b/js/lex_test.go @@ -1,4 +1,4 @@ -package js // import "github.com/tdewolff/parse/js" +package js import ( "bytes" diff --git a/json/parse.go b/json/parse.go index 6a7c8c7..5fa5933 100644 --- a/json/parse.go +++ b/json/parse.go @@ -1,5 +1,5 @@ // Package json is a JSON parser following the specifications at http://json.org/. -package json // import "github.com/tdewolff/parse/json" +package json import ( "io" diff --git a/json/parse_test.go b/json/parse_test.go index 71aa859..8c044c2 100644 --- a/json/parse_test.go +++ b/json/parse_test.go @@ -1,4 +1,4 @@ -package json // import "github.com/tdewolff/parse/json" +package json import ( "bytes" diff --git a/strconv/float.go b/strconv/float.go index da1a30d..ae13975 100644 --- a/strconv/float.go +++ b/strconv/float.go @@ -1,4 +1,4 @@ -package strconv // import "github.com/tdewolff/parse/strconv" +package strconv import "math" diff --git a/strconv/float_test.go b/strconv/float_test.go index b1f2cfb..fc96c98 100644 --- a/strconv/float_test.go +++ b/strconv/float_test.go @@ -1,4 +1,4 @@ -package strconv // import "github.com/tdewolff/parse/strconv" +package strconv import ( "fmt" diff --git a/strconv/int.go b/strconv/int.go index a84ecf3..ed174e0 100644 --- a/strconv/int.go +++ b/strconv/int.go @@ -1,4 +1,4 @@ -package strconv // import "github.com/tdewolff/parse/strconv" +package strconv import ( "math" diff --git a/strconv/int_test.go b/strconv/int_test.go index 2df2cdf..9a49fb2 100644 --- a/strconv/int_test.go +++ b/strconv/int_test.go @@ -1,4 +1,4 @@ -package strconv // import "github.com/tdewolff/parse/strconv" +package strconv import ( "math" diff --git a/strconv/price_test.go b/strconv/price_test.go index 97c39af..cebe532 100644 --- a/strconv/price_test.go +++ b/strconv/price_test.go @@ -1,4 +1,4 @@ -package strconv // import "github.com/tdewolff/parse/strconv" +package strconv import ( "testing" diff --git a/svg/hash_test.go b/svg/hash_test.go index c6ab75b..99aff43 100644 --- a/svg/hash_test.go +++ b/svg/hash_test.go @@ -1,4 +1,4 @@ -package svg // import "github.com/tdewolff/parse/svg" +package svg import ( "testing" diff --git a/util.go b/util.go index b7701a9..8e28c2c 100644 --- a/util.go +++ b/util.go @@ -1,4 +1,4 @@ -package parse // import "github.com/tdewolff/parse" +package parse // Copy returns a copy of the given byte slice. func Copy(src []byte) (dst []byte) { diff --git a/util_test.go b/util_test.go index 50d177e..930e532 100644 --- a/util_test.go +++ b/util_test.go @@ -1,4 +1,4 @@ -package parse // import "github.com/tdewolff/parse" +package parse import ( "bytes" diff --git a/xml/lex.go b/xml/lex.go index e35c298..c225bab 100644 --- a/xml/lex.go +++ b/xml/lex.go @@ -1,5 +1,5 @@ // Package xml is an XML1.0 lexer following the specifications at http://www.w3.org/TR/xml/. -package xml // import "github.com/tdewolff/parse/xml" +package xml import ( "io" diff --git a/xml/lex_test.go b/xml/lex_test.go index a0684f5..c603ab4 100644 --- a/xml/lex_test.go +++ b/xml/lex_test.go @@ -1,4 +1,4 @@ -package xml // import "github.com/tdewolff/parse/xml" +package xml import ( "bytes" diff --git a/xml/util.go b/xml/util.go index c397d49..155f353 100644 --- a/xml/util.go +++ b/xml/util.go @@ -1,4 +1,4 @@ -package xml // import "github.com/tdewolff/parse/xml" +package xml import "github.com/tdewolff/parse/v2" diff --git a/xml/util_test.go b/xml/util_test.go index 65be6b8..b29fb66 100644 --- a/xml/util_test.go +++ b/xml/util_test.go @@ -1,4 +1,4 @@ -package xml // import "github.com/tdewolff/parse/xml" +package xml import ( "testing"