golang怎么判断字符串是否为空

golang中判断字符串是否为空的方法:

if len(str) == 0{

}

或使用下面的方法判断:

if str == "" {

}

测试方法:

func Benchmark_Fun(b *testing.B) {

  .......

}

猜你喜欢

转载自www.cnblogs.com/mo3408/p/12185739.html