Standard library / crypto/x509/pkix

crypto/x509/pkix.AttributeTypeAndValue

A distinguished-name attribute with OID Type and arbitrary ASN.1-compatible Value. Expected stdout: 'Demo\n'.

Formal Syntax & Structure

go syntaxgo
type AttributeTypeAndValue struct {  Type  asn1.ObjectIdentifier  Value any}

Working Example

Example Snippetgo
package main
import (  "crypto/x509/pkix"  "encoding/asn1"  "fmt")
func main() {  a := pkix.AttributeTypeAndValue{Type: asn1.ObjectIdentifier{2, 5, 4, 3}, Value: "Demo"}  fmt.Println(a.Value)}
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference