strings.Builder+
golang code
代码是很简单的
package main
func main(){
var puts fmt.Sprintf
var builder strings.Builder
builder.WriteString(puts("0x%x,", blkHash))
builder.WriteString(puts("%d,", blkHeader.Number))
builder.WriteString(puts("0x%x,", getFromAddr(tx, big.NewInt(int64(i)))))
builder.WriteString(puts("0x%x,", txGas))
builder.WriteString(puts("0x%x,", txGasPrice))
builder.WriteString(puts("0x%x,", tx.Hash()))
builder.WriteString(puts("0x%x,", txInput))
builder.WriteString(puts("%v,", txNonce))
builder.WriteString(puts("%v,", txTo))
builder.WriteString(puts("%v,", txValue))
builder.String()
}
参考: