我如何将时间打印为这种格式23:44:22.184320

How do i print the time to this format?

23:44:22.184320

What I have tried is

func main() {
   // Which will print to the current time
   fmt.Println(time.Now())

   // How do I convert to
   // 23:44:22.184320
}

I have checked this link but I couldn't figure out how to do so https://gobyexample.com/time-formatting-parsing

Thanks!

Use this instead:

time.Now().Format("15:04:05.999999")

Note that the time layout for the time package is:

Mon Jan 2 15:04:05 MST 2006

time package