diff options
author | Glenn Vriesman <glenn.vriesman@gmail.com> | 2019-11-10 13:16:17 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-10 23:23:20 +1100 |
commit | 3f7e107d09a675b28783584d3643ee112206d905 (patch) | |
tree | d8622a53c93e2d89e9e3ddf1b0a647a28b6fa752 /vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go | |
parent | 22c0d79e2dbb8a6792664e1a56fa91f28592bbc0 (diff) |
Vendor: Updated dependenciesv0.10.2
* Updated go.mod
* Updated go.sum
* Updated vendor packages
Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go')
-rw-r--r-- | vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go new file mode 100644 index 000000000..0b76999ba --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go @@ -0,0 +1,35 @@ +package ini + +// isComment will return whether or not the next byte(s) is a +// comment. +func isComment(b []rune) bool { + if len(b) == 0 { + return false + } + + switch b[0] { + case ';': + return true + case '#': + return true + } + + return false +} + +// newCommentToken will create a comment token and +// return how many bytes were read. +func newCommentToken(b []rune) (Token, int, error) { + i := 0 + for ; i < len(b); i++ { + if b[i] == '\n' { + break + } + + if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { + break + } + } + + return newToken(TokenComment, b[:i], NoneType), i, nil +} |