Convert int and long to string in Go

I have a parallel procedure like this,

Routine 1()
{
for 30 times
Send string
}

Routine 2 (out <-chan string)
{
for
case str := <- out:
        fmt.Println(str)
}

Now I want to send from ordinary line 1, for example, string + int + string + system time in nanoseconds. Can anyone help me how can I achieve this.

+5
source share
1 answer

Sorry, I asked him too soon. It is possible:

out <- string + strconv.Itoa(int) + string + strconv.Itoa64(time.Nanoseconds())

Thank.


Update (Go1): strconv.Itoa64replaced by strconv.FormatInt.

+8
source

All Articles