Standard library / strings
strings.Builder.WriteByte()
Appends a single byte and returns nil error; the byte need not be valid UTF-8 by itself. Expected stdout: '<nil> A\n'.
Formal Syntax & Structure
go syntaxgo
func (b *Builder) WriteByte(c byte) errorParameters & Attributes
| Name | Type | Description |
|---|---|---|
| c | byte | Data to append or write. |
Return Value
error
Appends a single byte and returns nil error; the byte need not be valid UTF-8 by itself.
Working Example
Example Snippetgo
package main
import ( "fmt" "strings")
func main() { var b strings.Builder e := b.WriteByte(65) fmt.Println(e, b.String())}