如果可以将Println设置为变量,如何显示Println的错误值?

It says:

Printf formats according to a format specifier and writes to standard output. It returns the number of bytes written and any write error encountered.

How do I create/test an error and show the error if it is stored in b when I run the program it shows "nil" since no error, how can i show any error?

  a,b :=fmt.Println("Hello, playground")
    fmt.Println(a)
    fmt.Println(b)

https://golang.org/pkg/fmt/#Println
func Println(a ...interface{}) (n int, err error)
https://play.golang.org/p/8Cjb2Sfunx7

It is unusual to have Println errors, the docs also this. But if you are really interesting in doing a test of it, it works:

package main

import (
    "fmt"
    "os"
    "log"
)

func main() {
    const name, age = "Kim", 22
    os.Stdout.Close()
    _, err := fmt.Println(name, "is", age, "years old.")
    log.Fatal(err)

}

In order to artificially trigger an error we are closing the default Stdout file, used by Println. See the os documentation.