how to put a backquote in a backquoted string?
is it possible to print back quotes in Go using back quotes : something like this:
package main
import "fmt"
func main() {
fmt.Println(```) // for example I can do it with double quotes开发者_如何学Python "\""
}
package main
import "fmt"
func main() {
// back ` quote
fmt.Println((`back ` + "`" + ` quote`))
}
Raw string literals are character sequences between back quotes ``. Within the quotes, any character is legal except back quote. The value of a raw string literal is the string composed of the uninterpreted characters between the quotes; in particular, backslashes have no special meaning and the string may span multiple lines. String literals
You can also do it with single quotes:
package main
import "fmt"
func main() {
fmt.Printf("%c\n", '`')
}
https://golang.org/pkg/fmt#Printf
TLDR
fmt.Println("\x60")
\x: Hex see fmt
6016 9610 1408 matches the character ` grave accent
精彩评论