Skip to content

Commit 89eb0c0

Browse files
committed
cmd/compile/internal/importer: clean up support.go
1 parent 3cefe69 commit 89eb0c0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/cmd/compile/internal/importer/support.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package importer
88

99
import (
1010
"cmd/compile/internal/base"
11+
"cmd/compile/internal/types"
1112
"cmd/compile/internal/types2"
1213
"fmt"
1314
"go/token"
@@ -23,8 +24,6 @@ func errorf(format string, args ...interface{}) {
2324
panic(fmt.Sprintf(format, args...))
2425
}
2526

26-
const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go
27-
2827
// Synthesize a token.Pos
2928
type fakeFileSet struct {
3029
fset *token.FileSet
@@ -67,13 +66,12 @@ var (
6766
)
6867

6968
func chanDir(d int) types2.ChanDir {
70-
// tag values must match the constants in cmd/compile/internal/gc/go.go
71-
switch d {
72-
case 1 /* Crecv */ :
69+
switch types.ChanDir(d) {
70+
case types.Crecv:
7371
return types2.RecvOnly
74-
case 2 /* Csend */ :
72+
case types.Csend:
7573
return types2.SendOnly
76-
case 3 /* Cboth */ :
74+
case types.Cboth:
7775
return types2.SendRecv
7876
default:
7977
errorf("unexpected channel dir %d", d)

0 commit comments

Comments
 (0)