In Go, a string is a primitive type, which means it is read-only, and every manipulation of it will create a new string. So if I want to concatenate strings many times without knowing the length of the resulting string, what's the best way to do it? The naive way would be: var s string for i := 0; i < 1000; i++ { s += getShortStringFromSomewhere() } return s but that does not seem very efficient.
I've used GOPATH but for this current issue I'm facing it does not help. I want to be able to create packages that are specific to a project: myproject/ ├── binary1.go ├── binary2.go ├── package1.go └── package2.go I tried multiple ways but how do I get package1.go to work in the binary1.go or the binary2.go and so on? For example; I want to be able to import "package1" and then be able to run go
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く