summaryrefslogtreecommitdiff
path: root/vendor/github.com/jackc/pgservicefile/pgservicefile.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-09-16 09:26:41 +0200
committerLibravatar GitHub <noreply@github.com>2024-09-16 09:26:41 +0200
commitca729aa4a06b5d7e5587e2b2e2a0b87bfb17513c (patch)
tree15147a61f3a12edba73c2add3aabf620b49c5d36 /vendor/github.com/jackc/pgservicefile/pgservicefile.go
parent[bugfix] Hoist filterable text field extraction out of loop (#3297) (diff)
downloadgotosocial-ca729aa4a06b5d7e5587e2b2e2a0b87bfb17513c.tar.xz
[chore]: Bump github.com/jackc/pgx/v5 from 5.6.0 to 5.7.1 (#3302)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.6.0 to 5.7.1. - [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v5.6.0...v5.7.1) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v5 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/jackc/pgservicefile/pgservicefile.go')
-rw-r--r--vendor/github.com/jackc/pgservicefile/pgservicefile.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/github.com/jackc/pgservicefile/pgservicefile.go b/vendor/github.com/jackc/pgservicefile/pgservicefile.go
index 797bbab9e..c62caa7fe 100644
--- a/vendor/github.com/jackc/pgservicefile/pgservicefile.go
+++ b/vendor/github.com/jackc/pgservicefile/pgservicefile.go
@@ -57,7 +57,7 @@ func ParseServicefile(r io.Reader) (*Servicefile, error) {
} else if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
service = &Service{Name: line[1 : len(line)-1], Settings: make(map[string]string)}
servicefile.Services = append(servicefile.Services, service)
- } else {
+ } else if service != nil {
parts := strings.SplitN(line, "=", 2)
if len(parts) != 2 {
return nil, fmt.Errorf("unable to parse line %d", lineNum)
@@ -67,6 +67,8 @@ func ParseServicefile(r io.Reader) (*Servicefile, error) {
value := strings.TrimSpace(parts[1])
service.Settings[key] = value
+ } else {
+ return nil, fmt.Errorf("line %d is not in a section", lineNum)
}
}