Golang中的string和.String()问题

I can't understand the following behaviour in Go:

package main

import "fmt"

type Something string

func (a *Something) String() string {
  return "Bye"
}

func main() {
  a := Something("Hello")

  fmt.Printf("%s
", a)
  fmt.Printf("%s
", a.String())
}

Will output:

Hello
Bye

Somehow this feels kinda incosistent. Is this expected behaviour? Can someone help me out here?

Your String() is defined on the pointer but you're passing a value to Printf.

Either change it to:

func (Something) String() string {
    return "Bye"
}

or use

fmt.Printf("%s
", &a)

The arguments types are different. For example,

package main

import "fmt"

type Something string

func (a *Something) String() string {
    return "Bye"
}

func main() {
    a := Something("Hello")

    fmt.Printf("%T %s
", a, a)
    fmt.Printf("%T %s
", a.String(), a.String())
}

Output:

main.Something Hello
string Bye