Revert changes to dyn.Location

This commit is contained in:
Pieter Noordhuis 2025-01-27 17:05:04 +01:00
parent 76c671f72b
commit 80cbfe9da3
No known key found for this signature in database
GPG Key ID: 12ACCCC104CF2930
2 changed files with 3 additions and 11 deletions

View File

@ -7,9 +7,9 @@ import (
) )
type Location struct { type Location struct {
File string `json:"file"` File string
Line int `json:"line"` Line int
Column int `json:"column"` Column int
} }
func (l Location) String() string { func (l Location) String() string {

View File

@ -1,7 +1,6 @@
package dyn_test package dyn_test
import ( import (
"encoding/json"
"testing" "testing"
"github.com/databricks/cli/libs/dyn" "github.com/databricks/cli/libs/dyn"
@ -25,10 +24,3 @@ func TestLocationDirectoryNoFile(t *testing.T) {
_, err := loc.Directory() _, err := loc.Directory()
assert.Error(t, err) assert.Error(t, err)
} }
func TestLocationMarshal(t *testing.T) {
loc := dyn.Location{File: "file", Line: 1, Column: 2}
buf, err := json.Marshal(loc)
assert.NoError(t, err)
assert.Equal(t, `{"file":"file","line":1,"column":2}`, string(buf))
}