``` go
func Rem(a []string) (ret []string) {
now:=time.Now()
sort.Strings(a)
finish:=time.Since(now)
fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
sss:=strconv.FormatInt(int64(finish),10)
fmt.Printf("%s",sss)
fmt.Println("sss:"+sss)
aaa:=int64(finish)
fmt.Println(aaa)
fmt.Println(int64(finish))
fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
return ret
}
```
sss和aaa打印出来就是零,但是调试的时候sss和aaa明明就是有值的啊
<a href="/user/ddxx11223" title="@ddxx11223">@ddxx11223</a> ,你试试用 %v 打印出来看下,我的结果很正常啊
```
package main
import (
"time"
"fmt"
"sort"
)
func Rem(a []string) (ret []string) {
now:=time.Now()
sort.Strings(a)
finish:=time.Since(now)
fmt.Printf("%v\n", finish)
return ret
}
func main(){
Rem([]string{"hello", "world"})
}
```
输出结果:
```
$ go run good.go
800ns
$
```
#10
更多评论