github.com/songzhibin97/go-baseutils@v0.0.2-0.20240302024150-487d8ce9c082/base/banytostring/example_test.go (about)

     1  package banytostring
     2  
     3  import "fmt"
     4  
     5  func ExampleToStringE() {
     6  	v := "test"
     7  	nv, err := ToStringE(v)
     8  	if err != nil {
     9  		fmt.Println(err)
    10  		return
    11  	}
    12  	fmt.Println(nv) // test
    13  }
    14  
    15  func ExampleToString() {
    16  	v := "test"
    17  	fmt.Println(ToString(v)) // test
    18  }