mirror of
https://github.com/golang/go
synced 2024-11-18 01:04:48 -07:00
internal/span: remove check for nil content
We should instead treat nil content as an empty file. Change-Id: I45f1d1c9f3382d2ef7f6d9769c808fd871d603e3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/252122 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
cf97e2b30f
commit
bf6e7d25bf
@ -15,9 +15,6 @@ import (
|
||||
// This is used to convert from the native (always in bytes) column
|
||||
// representation and the utf16 counts used by some editors.
|
||||
func ToUTF16Column(p Point, content []byte) (int, error) {
|
||||
if content == nil {
|
||||
return -1, fmt.Errorf("ToUTF16Column: missing content")
|
||||
}
|
||||
if !p.HasPosition() {
|
||||
return -1, fmt.Errorf("ToUTF16Column: point is missing position")
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ var toUTF16Tests = []struct {
|
||||
{
|
||||
scenario: "cursor missing content",
|
||||
input: nil,
|
||||
err: "ToUTF16Column: missing content",
|
||||
err: "ToUTF16Column: point is missing position",
|
||||
},
|
||||
{
|
||||
scenario: "cursor missing position",
|
||||
|
Loading…
Reference in New Issue
Block a user