編譯問題,**如下,注釋內的即編譯錯誤的**
package main
import "fmt"
type t struct
func (t t) next() t
}func main() ; t.field
< 10; t = t.next
() */
// this is fine
t2 := t
for ; t2.field < 10; t2 = t2.next()
}
雖然說,也許這麼寫從理論上講也需要支援,但是這個編譯問題並不是嚴重到go語言非得去立即修正不可,而且對於語法解析,這裡真的有很大的難度。。
當然也有規避方法,**寫成這樣就可以了。
func main() ); t.field < 10; t = t.next()
}
go學習遇到的問題記錄
1.解決 fatal unable to access could not resolve host github.com問題 2.解決go get慢問題 go env w go111module on go env w goproxy 在 gopath pkg mode下 4.goland imp...
筆試問題記錄2
true false 2 true 結果是 false 分析 true false 被轉換成了 1 0 1 1 3為false 輸出結果為 1 hehe endthen ok 2 var a 1 var obj obj.b.c 輸出結果為 end 分析 在這個問題中this會指向距離它最近的,呼叫它...
python編碼問題記錄2
python3中 此qr資料是utf 8編碼的資料格式,並指定errors的錯誤處理方式errors ignore 在讀,寫資料的時候直接指定編碼格式 with open data path,r encoding utf 8 errors ignore as file content 整個讀入和寫進...