Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
interfaces/mount: add function for parsing fstab-like file #3103
+58
−0
Conversation
zyga
added some commits
Mar 29, 2017
zyga
referenced this pull request
Mar 30, 2017
Merged
interfaces/mount: add function for saving fstab-like file #3114
| + scanner := bufio.NewScanner(reader) | ||
| + for scanner.Scan() { | ||
| + s := strings.TrimSpace(scanner.Text()) | ||
| + if i := strings.Index(s, "#"); i != -1 { |
| + s := strings.TrimSpace(scanner.Text()) | ||
| + if i := strings.Index(s, "#"); i != -1 { | ||
| + s = strings.TrimSpace(s[0:i]) | ||
| + } |
chipaca
Mar 30, 2017
Member
to me at least it'd make more sense if you trimmed the comment first, and trimmed the space second. Like
s := scanner.Text()
if i := strings.IndexByte(s, '#') {
s = s[:i]
}
s = strings.TrimSpace(s)|
LGTM |
zyga
merged commit d54164a
into
snapcore:master
Mar 31, 2017
1 of 6 checks passed
xenial-amd64
autopkgtest finished (failure)
Details
xenial-i386
autopkgtest finished (failure)
Details
xenial-ppc64el
autopkgtest finished (failure)
Details
yakkety-amd64
autopkgtest finished (failure)
Details
zesty-amd64
autopkgtest finished (failure)
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
zyga
deleted the
zyga:load-fstab-file
branch
Mar 31, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zyga commentedMar 29, 2017
This is stacked on top of #3102. The new thing is the 2nd commit with a function for parsing a fstab-like file.