70 Commits

Author SHA1 Message Date
Kevin Burke 01f96b0aa0 AUTHORS.txt: add Mark Nevill
Also change addresses to use my new email.
2019-07-24 19:47:13 -10:00
Kevin Burke 6cfae18c12 1.0 2019-07-24 10:58:21 -10:00
Mark Nevill 14846fb743 all: rewrite the lexer to consume the entire input first
Previously we used the buffruneio package to buffer input. However,
the error handling was not good, and we would often panic when parsing
inputs.

SSH config files are generally not large, on the order of kilobytes or
megabytes, and it's fine to just read the entire thing into memory and
then parse from there. This also simplifies the parser significantly
and lets us remove a dependency and several defer calls.

Add a test that panicked with the old version and then modify the code
to ensure the test no longer panics.

Thanks to Mark Nevill (@devnev) for the initial error report and
failing test case.

Fixes #10.
Fixes #24.
2019-07-24 10:52:01 -10:00
Kevin Burke 2e50c44127 all: fix lint issues
staticcheck updated, and it requires inline fixes as well as dropping
support for 1.9 and 1.10.
2019-06-29 21:04:20 -07:00
Kevin Burke f648cfb84b all: use ints instead of uints
Files are small and these are cheap enough that we should be more
worried about overflow errors than the space cost.
2019-06-29 20:37:49 -07:00
Kevin Burke 81db2a7582 0.5 2018-08-30 14:53:28 -06:00
Kevin Burke b64c0219b6 Add Go 1.11 to build matrix 2018-08-30 14:47:24 -06:00
Kevin Burke 555f37af0a Correctly parse files without trailing newline
If the file did not have a newline character as the last character,
parseKV() would panic with an NPE. Handle the parser changes better.

Fixes #21.
2018-08-30 14:46:27 -06:00
Kevin Burke 82cf3f9264 Remove 1.7 and 1.8 from build matrix
They don't work with megacheck anymore. The source code and tests will
probably still pass, however.
2018-07-11 09:47:46 -07:00
Kevin Burke 4fcc689bee Use kevinburke/bump_version instead of Shyp/bump_version 2018-04-22 12:34:03 -07:00
Wayne Ashley Berry 6c3af74fa5 Run tests with the race detector
At some point recently this was fixed (maybe investigate more and
figure out how/why this has been resolved?)

Add Go 1.10 to Travis CI.
2018-04-02 20:41:57 -07:00
Kevin Burke b8c871d977 run tests before releasing a new version 2018-03-17 10:56:17 -07:00
Kevin Burke 9fc7bb800b 0.4 2018-03-17 10:55:31 -07:00
Eugene Terentev fe204ef364 Fix DOS line endings parsing
Previously we would fail to lex lines ending with CRLF properly.
2018-03-17 10:50:38 -07:00
Kevin Burke 0ff8514904 0.3 2018-01-27 11:48:58 -08:00
Kevin Burke fc20c60f74 Add AUTHORS file 2018-01-27 11:48:38 -08:00
Sergey Lukjanov c665f6f442 Fix potential index out of range error
I had some extra spaces and junk in my ssh config and it was causing
this part of the code to fail with an out of range error.
2018-01-27 11:46:18 -08:00
Kevin Burke 802051befe Implement encoding.TextMarshaler interface 2017-10-13 14:14:58 -07:00
Kevin Burke db49ba357d Use better dependencies in Makefile 2017-08-22 10:15:53 -07:00
Kevin Burke 4ec3da02a7 add Default example 2017-05-26 11:07:48 -07:00
Kevin Burke fc8c332031 fix example 2017-05-26 11:06:09 -07:00
Kevin Burke 2b54512628 switch staticcheck for megacheck and fix things it complains about 2017-05-26 10:01:24 -07:00
Kevin Burke 6dcd4cf595 update README and add more examples 2017-05-25 22:05:04 -07:00
Kevin Burke 873a8ad95f add errata 2017-05-25 08:22:23 -07:00
Kevin Burke 8b24c0d360 improve the documentation 2017-05-25 08:16:57 -07:00