Skip to content

Commit

Permalink
golangci-lint: enable unconvert
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Dec 26, 2021
1 parent b7aa5f8 commit 1ee0025
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .golangci.yaml
Expand Up @@ -41,6 +41,7 @@ linters:
- "stylecheck"
- "tenv"
- "typecheck"
- "unconvert"
- "unused"
- "varcheck"
issues:
Expand Down
2 changes: 1 addition & 1 deletion internal/datastore/postgres/postgres.go
Expand Up @@ -260,7 +260,7 @@ func (pgd *pgDatastore) getNow(ctx context.Context) (time.Time, error) {
func (pgd *pgDatastore) collectGarbage() error {
startTime := time.Now()
defer func() {
gcDurationHistogram.Observe(float64(time.Since(startTime).Seconds()))
gcDurationHistogram.Observe(time.Since(startTime).Seconds())
}()

ctx, cancel := context.WithTimeout(context.Background(), pgd.gcMaxOperationTime)
Expand Down
6 changes: 3 additions & 3 deletions pkg/schemadsl/input/sourcepositionmapper.go
Expand Up @@ -31,9 +31,9 @@ func CreateSourcePositionMapper(contents []byte) SourcePositionMapper {

currentStart := int(0)
for index, line := range lines {
lineEnd := currentStart + int(len(line))
rangeTree.Put(inclusiveRange{currentStart, lineEnd}, lineAndStart{int(index), currentStart})
lineMap[int(index)] = inclusiveRange{currentStart, lineEnd}
lineEnd := currentStart + len(line)
rangeTree.Put(inclusiveRange{currentStart, lineEnd}, lineAndStart{index, currentStart})
lineMap[index] = inclusiveRange{currentStart, lineEnd}
currentStart = lineEnd + 1
}

Expand Down

0 comments on commit 1ee0025

Please sign in to comment.