WriteString in Go

Posted by GoDoc
Public (Editable by Users)

WriteString writes the contents of the string s to w, which accepts a slice of bytes. If w implements StringWriter, its WriteString method is invoked directly. Otherwise, w.Write is called exactly once.

Go
Edit
package main

import (
	"io"
	"os"
)

func main() {
	io.WriteString(os.Stdout, "Hello World")
}