这是Java代码:
AtomicInteger obIndex = new AtomicInteger(0);
MessageFormat.format("{0,number,#},{1},{2},{3},\"{4}\"",
obIndex.getAndIncrement(),
"5bb2b35c67525f9e845648df370652b8",
"Vm:vm-289",
"1.1.1.1:113",
"ABC-Testvm-1");
输出:
0,5bb2b35c67525f9e845648df370652b8,Vm:vm-289,1.1.1.1:113,"ABC-Testvm-1"
我在 Go 中试过这个:
value := fmt.Sprintf("%d,%s,%s,%s,%s",
0,
"5bb2b35c67525f9e845648df370652b8",
"Vm:vm-289",
"1.1.1.1:113", "ABC-Testvm-1")
fmt.Println(value)
哪个输出:
0,5bb2b35c67525f9e845648df370652b8,Vm:vm-289,1.1.1.1:113,ABC-Testvm-1
Go的意义是什么,{0,number,#}
我怎样才能得到相同的含义?