considering this code

package main

import (

func main() {
host := []string{"127", "0", "0", "1"}

fmt.Printf("%v.%v.%v.%v\n", host[0], host[1], host[2], host[3])
fmt.Printf("%v.%v.%v.%v\n", host[0:4]...)

The first Printf works and prints the host value.
While the second one does not compile : "./args.go:11:34: cannot use 
host[0:4] (type []string) as type []interface {} in argument to fmt.Printf"

If I use append() instead of Printf(), this expanding of the host variables 
just works out. Is this a compiler bug in the case of the fmt.Printf() ?


You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Reply via email to