初級 › imported and not used の原因と直し方 › パターン5
imported and not used の原因と直し方
importしたパッケージを一度も使わないとコンパイルエラーになります。
1 package main 2 3 import ( 4 "fmt" 5 _________ ^ 6 ) 7 8 func main() { 9 fmt.Println("hi") 10 }
./main.go:5:2: "sort" imported and not used
空欄を埋めて実行を通す
sort.Intsで並べ替える予定だったコードを削った後にimportが残ると、このエラーになります。
次の問題