Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@
bad=$(
# Snapshot outputs are generated with modified
# indentation for alignment with annotations.
# pr261's input intentionally keeps an "unused" import
# to reproduce a panic on a bare PkgName ident.
find . -name '*.go' \
-not -path '*/testdata/snapshots/output/*' \
-not -path '*/testdata/snapshots/input/pr261/*' \
-exec ${pkgs.gotools}/bin/goimports -l {} +
)
if [ -n "$bad" ]; then
Expand Down
4 changes: 4 additions & 0 deletions internal/testdata/snapshots/input/pr261/bare_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ package pr261

import "sort"

// Legitimate use so goimports doesn't strip the import.
var _ = sort.Slice

// Bare PkgName reference that triggered the panic.
var _ = sort
6 changes: 6 additions & 0 deletions internal/testdata/snapshots/output/pr261/bare_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
import "sort"
// ^^^^ reference github.com/golang/go/src go1.22 sort/

// Legitimate use so goimports doesn't strip the import.
var _ = sort.Slice
// ^^^^ reference github.com/golang/go/src go1.22 sort/
// ^^^^^ reference github.com/golang/go/src go1.22 sort/Slice().

// Bare PkgName reference that triggered the panic.
var _ = sort

Loading