Standard library / encoding/base64

encoding/base64.CorruptInputError

Integer error type identifying a malformed Base64 byte offset. Use errors.As to inspect it. Expected stdout: 'true 0\n'.

Formal Syntax & Structure

go syntaxgo
type CorruptInputError int64

Working Example

Example Snippetgo
package main
import (  "encoding/base64"  "errors"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() {  _, e := base64.StdEncoding.DecodeString("!")  var bad base64.CorruptInputError  fmt.Println(errors.As(e, &bad), int64(bad))}
Go Reference