diff --git a/cmd/scip/lint.go b/cmd/scip/lint.go index 88dd8e58..3361dc5e 100644 --- a/cmd/scip/lint.go +++ b/cmd/scip/lint.go @@ -113,7 +113,7 @@ type occurrenceKey struct { } func scipOccurrenceKey(occ *scip.Occurrence) occurrenceKey { - return occurrenceKey{*scip.NewRange(occ.Range), occ.SymbolRoles} + return occurrenceKey{scip.NewRange(occ.Range), occ.SymbolRoles} } type occurrenceMap = map[occurrenceKey]*scip.Occurrence @@ -202,16 +202,16 @@ func (st *symbolTable) addRelationship(sym string, path string, rel *scip.Relati func (st *symbolTable) addOccurrence(path string, occ *scip.Occurrence) error { if occ.Symbol == "" { - return emptyStringError{what: "symbol", context: fmt.Sprintf("occurrence at %s @ %s", path, scipRangeToString(*scip.NewRange(occ.Range)))} + return emptyStringError{what: "symbol", context: fmt.Sprintf("occurrence at %s @ %s", path, scipRangeToString(scip.NewRange(occ.Range)))} } if scip.SymbolRole_Definition.Matches(occ) && scip.SymbolRole_ForwardDefinition.Matches(occ) { - return forwardDefIsDefinitionError{occ.Symbol, path, *scip.NewRange(occ.Range)} + return forwardDefIsDefinitionError{occ.Symbol, path, scip.NewRange(occ.Range)} } tryInsertOccurrence := func(occMap fileOccurrenceMap) error { occKey := scipOccurrenceKey(occ) if fileOccs, ok := occMap[path]; ok { if _, ok := fileOccs[occKey]; ok { - return duplicateOccurrenceWarning{occ.Symbol, path, *scip.NewRange(occ.Range), occ.SymbolRoles} + return duplicateOccurrenceWarning{occ.Symbol, path, scip.NewRange(occ.Range), occ.SymbolRoles} } else { fileOccs[occKey] = occ } @@ -231,7 +231,7 @@ func (st *symbolTable) addOccurrence(path string, occ *scip.Occurrence) error { return err } } else { - return missingSymbolForOccurrenceError{occ.Symbol, path, *scip.NewRange(occ.Range)} + return missingSymbolForOccurrenceError{occ.Symbol, path, scip.NewRange(occ.Range)} } return nil } diff --git a/cmd/scip/lint_test.go b/cmd/scip/lint_test.go index 3b965192..4afa3247 100644 --- a/cmd/scip/lint_test.go +++ b/cmd/scip/lint_test.go @@ -167,15 +167,15 @@ func TestErrors(t *testing.T) { "missingSymbolForOccurrence", makeIndex(nil, nil, stringMap{"f": {"a"}}), []error{ - missingSymbolForOccurrenceError{"a", "f", *scip.NewRange(placeholderRange)}, + missingSymbolForOccurrenceError{"a", "f", scip.NewRange(placeholderRange)}, }, }, { "duplicateOccurrence", makeIndex([]string{"a"}, stringMap{"f": {"b"}}, stringMap{"f": {"a", "a", "b", "b"}}), []error{ - duplicateOccurrenceWarning{"a", "f", *scip.NewRange(placeholderRange), placeholderRole}, - duplicateOccurrenceWarning{"b", "f", *scip.NewRange(placeholderRange), placeholderRole}, + duplicateOccurrenceWarning{"a", "f", scip.NewRange(placeholderRange), placeholderRole}, + duplicateOccurrenceWarning{"b", "f", scip.NewRange(placeholderRange), placeholderRole}, }, }, }