Standard library / go/constant
go/constant.StringVal()
Extract unquoted string content; Unknown yields an empty string. Expected stdout: 'Go\n'.
Formal Syntax & Structure
go syntaxgo
func StringVal(x Value) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | Value | Input constant or Go value as specified by the function. |
Return Value
string
Extract unquoted string content; Unknown yields an empty string.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/constant")
func main() { fmt.Println(constant.StringVal(constant.MakeString("Go"))) }