| 1 | // Copyright 2019 The age Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package agescip-go gomod filippo.io/age . `filippo.io/age`/ |
| 6 | |
| 7 | import ( |
| 8 | "crypto/randscip-go gomod github.com/golang/go/src . `crypto/rand`/" |
| 9 | "crypto/sha256scip-go gomod github.com/golang/go/src . `crypto/sha256`/" |
| 10 | "errorsscip-go gomod github.com/golang/go/src . errors/" |
| 11 | "fmtscip-go gomod github.com/golang/go/src . fmt/" |
| 12 | "ioscip-go gomod github.com/golang/go/src . io/" |
| 13 | "stringsscip-go gomod github.com/golang/go/src . strings/" |
| 14 | |
| 15 | "filippo.io/age/internal/bech32scip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/" |
| 16 | "filippo.io/age/internal/formatscip-go gomod filippo.io/age . `filippo.io/age/internal/format`/" |
| 17 | "golang.org/x/crypto/chacha20poly1305scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/chacha20poly1305`/" |
| 18 | "golang.org/x/crypto/curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/" |
| 19 | "golang.org/x/crypto/hkdfscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/hkdf`/" |
| 20 | ) |
| 21 | |
| 22 | const x25519Labelscip-go gomod filippo.io/age . `filippo.io/age`/x25519Label. = "age-encryption.org/v1/X25519" |
| 23 | |
| 24 | // X25519Recipient is the standard age pre-quantum public key. Messages |
| 25 | // encrypted to this recipient can be decrypted with the corresponding |
| 26 | // [X25519Identity]. For post-quantum resistance, use [HybridRecipient]. |
| 27 | // |
| 28 | // This recipient is anonymous, in the sense that an attacker can't tell from |
| 29 | // the message alone if it is encrypted to a certain recipient. |
| 30 | type X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient# struct { |
| 31 | theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey. []byte |
| 32 | } |
| 33 | |
| 34 | var _ Recipientscip-go gomod filippo.io/age . `filippo.io/age`/Recipient# = &X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#{} |
| 35 | |
| 36 | // newX25519RecipientFromPoint returns a new X25519Recipient from a raw Curve25519 point. |
| 37 | func newX25519RecipientFromPointscip-go gomod filippo.io/age . `filippo.io/age`/newX25519RecipientFromPoint().(publicKey []byte) (*X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#, error) { |
| 38 | if len(publicKey) != curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.PointSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/PointSize. { |
| 39 | return nil, errorsscip-go gomod github.com/golang/go/src . errors/.Newscip-go gomod github.com/golang/go/src . errors/New().("invalid X25519 public key") |
| 40 | } |
| 41 | r := &X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#{ |
| 42 | theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey.: make([]byte, curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.PointSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/PointSize.), |
| 43 | } |
| 44 | copy(r.theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey., publicKey) |
| 45 | return r, nil |
| 46 | } |
| 47 | |
| 48 | // ParseX25519Recipient returns a new X25519Recipient from a Bech32 public key |
| 49 | // encoding with the "age1" prefix. |
| 50 | func ParseX25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/ParseX25519Recipient().(s string) (*X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#, error) { |
| 51 | t, k, err := bech32scip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/.Decodescip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/Decode().(s) |
| 52 | if err != nil { |
| 53 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("malformed recipient %q: %v", s, err) |
| 54 | } |
| 55 | if t != "age" { |
| 56 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("malformed recipient %q: invalid type %q", s, t) |
| 57 | } |
| 58 | r, err := newX25519RecipientFromPointscip-go gomod filippo.io/age . `filippo.io/age`/newX25519RecipientFromPoint().(k) |
| 59 | if err != nil { |
| 60 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("malformed recipient %q: %v", s, err) |
| 61 | } |
| 62 | return r, nil |
| 63 | } |
| 64 | |
| 65 | func (r *X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#) Wrapscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#Wrap().(fileKey []byte) ([]*Stanzascip-go gomod filippo.io/age . `filippo.io/age`/Stanza#, error) { |
| 66 | ephemeral := make([]byte, curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.ScalarSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/ScalarSize.) |
| 67 | if _, err := randscip-go gomod github.com/golang/go/src . `crypto/rand`/.Readscip-go gomod github.com/golang/go/src . `crypto/rand`/Read().(ephemeral); err != nil { |
| 68 | return nil, err |
| 69 | } |
| 70 | ourPublicKey, err := curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.X25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/X25519().(ephemeral, curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.Basepointscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/Basepoint.) |
| 71 | if err != nil { |
| 72 | return nil, err |
| 73 | } |
| 74 | |
| 75 | sharedSecret, err := curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.X25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/X25519().(ephemeral, r.theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey.) |
| 76 | if err != nil { |
| 77 | return nil, err |
| 78 | } |
| 79 | |
| 80 | l := &Stanzascip-go gomod filippo.io/age . `filippo.io/age`/Stanza#{ |
| 81 | Typescip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Type.: "X25519", |
| 82 | Argsscip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Args.: []string{formatscip-go gomod filippo.io/age . `filippo.io/age/internal/format`/.EncodeToStringscip-go gomod filippo.io/age . `filippo.io/age/internal/format`/EncodeToString.(ourPublicKey)}, |
| 83 | } |
| 84 | |
| 85 | salt := make([]byte, 0, len(ourPublicKey)+len(r.theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey.)) |
| 86 | salt = append(salt, ourPublicKey...) |
| 87 | salt = append(salt, r.theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey....) |
| 88 | h := hkdfscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/hkdf`/.Newscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/hkdf`/New().(sha256scip-go gomod github.com/golang/go/src . `crypto/sha256`/.Newscip-go gomod github.com/golang/go/src . `crypto/sha256`/New()., sharedSecret, salt, []byte(x25519Labelscip-go gomod filippo.io/age . `filippo.io/age`/x25519Label.)) |
| 89 | wrappingKey := make([]byte, chacha20poly1305scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/chacha20poly1305`/.KeySizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/chacha20poly1305`/KeySize.) |
| 90 | if _, err := ioscip-go gomod github.com/golang/go/src . io/.ReadFullscip-go gomod github.com/golang/go/src . io/ReadFull().(h, wrappingKey); err != nil { |
| 91 | return nil, err |
| 92 | } |
| 93 | |
| 94 | wrappedKey, err := aeadEncryptscip-go gomod filippo.io/age . `filippo.io/age`/aeadEncrypt().(wrappingKey, fileKey) |
| 95 | if err != nil { |
| 96 | return nil, err |
| 97 | } |
| 98 | l.Bodyscip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Body. = wrappedKey |
| 99 | |
| 100 | return []*Stanzascip-go gomod filippo.io/age . `filippo.io/age`/Stanza#{l}, nil |
| 101 | } |
| 102 | |
| 103 | // String returns the Bech32 public key encoding of r. |
| 104 | func (r *X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#) Stringscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#String().() string { |
| 105 | s, _ := bech32scip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/.Encodescip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/Encode().("age", r.theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey.) |
| 106 | return s |
| 107 | } |
| 108 | |
| 109 | // X25519Identity is the standard pre-quantum age private key, which can decrypt |
| 110 | // messages encrypted to the corresponding [X25519Recipient]. For post-quantum |
| 111 | // resistance, use [HybridIdentity]. |
| 112 | type X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity# struct { |
| 113 | secretKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#secretKey., ourPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#ourPublicKey. []byte |
| 114 | } |
| 115 | |
| 116 | var _ Identityscip-go gomod filippo.io/age . `filippo.io/age`/Identity# = &X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#{} |
| 117 | |
| 118 | // newX25519IdentityFromScalar returns a new X25519Identity from a raw Curve25519 scalar. |
| 119 | func newX25519IdentityFromScalarscip-go gomod filippo.io/age . `filippo.io/age`/newX25519IdentityFromScalar().(secretKey []byte) (*X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#, error) { |
| 120 | if len(secretKey) != curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.ScalarSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/ScalarSize. { |
| 121 | return nil, errorsscip-go gomod github.com/golang/go/src . errors/.Newscip-go gomod github.com/golang/go/src . errors/New().("invalid X25519 secret key") |
| 122 | } |
| 123 | i := &X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#{ |
| 124 | secretKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#secretKey.: make([]byte, curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.ScalarSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/ScalarSize.), |
| 125 | } |
| 126 | copy(i.secretKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#secretKey., secretKey) |
| 127 | i.ourPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#ourPublicKey., _ = curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.X25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/X25519().(i.secretKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#secretKey., curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.Basepointscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/Basepoint.) |
| 128 | return i, nil |
| 129 | } |
| 130 | |
| 131 | // GenerateX25519Identity randomly generates a new X25519Identity. |
| 132 | func GenerateX25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/GenerateX25519Identity().() (*X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#, error) { |
| 133 | secretKey := make([]byte, curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.ScalarSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/ScalarSize.) |
| 134 | if _, err := randscip-go gomod github.com/golang/go/src . `crypto/rand`/.Readscip-go gomod github.com/golang/go/src . `crypto/rand`/Read().(secretKey); err != nil { |
| 135 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("internal error: %v", err) |
| 136 | } |
| 137 | return newX25519IdentityFromScalarscip-go gomod filippo.io/age . `filippo.io/age`/newX25519IdentityFromScalar().(secretKey) |
| 138 | } |
| 139 | |
| 140 | // ParseX25519Identity returns a new X25519Identity from a Bech32 private key |
| 141 | // encoding with the "AGE-SECRET-KEY-1" prefix. |
| 142 | func ParseX25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/ParseX25519Identity().(s string) (*X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#, error) { |
| 143 | t, k, err := bech32scip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/.Decodescip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/Decode().(s) |
| 144 | if err != nil { |
| 145 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("malformed secret key: %v", err) |
| 146 | } |
| 147 | if t != "AGE-SECRET-KEY-" { |
| 148 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("malformed secret key: unknown type %q", t) |
| 149 | } |
| 150 | r, err := newX25519IdentityFromScalarscip-go gomod filippo.io/age . `filippo.io/age`/newX25519IdentityFromScalar().(k) |
| 151 | if err != nil { |
| 152 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("malformed secret key: %v", err) |
| 153 | } |
| 154 | return r, nil |
| 155 | } |
| 156 | |
| 157 | func (i *X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#) Unwrapscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#Unwrap().(stanzas []*Stanzascip-go gomod filippo.io/age . `filippo.io/age`/Stanza#) ([]byte, error) { |
| 158 | return multiUnwrapscip-go gomod filippo.io/age . `filippo.io/age`/multiUnwrap().(i.unwrapscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#unwrap()., stanzas) |
| 159 | } |
| 160 | |
| 161 | func (i *X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#) unwrapscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#unwrap().(block *Stanzascip-go gomod filippo.io/age . `filippo.io/age`/Stanza#) ([]byte, error) { |
| 162 | if block.Typescip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Type. != "X25519" { |
| 163 | return nil, ErrIncorrectIdentityscip-go gomod filippo.io/age . `filippo.io/age`/ErrIncorrectIdentity. |
| 164 | } |
| 165 | if len(block.Argsscip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Args.) != 1 { |
| 166 | return nil, errorsscip-go gomod github.com/golang/go/src . errors/.Newscip-go gomod github.com/golang/go/src . errors/New().("invalid X25519 recipient block") |
| 167 | } |
| 168 | publicKey, err := formatscip-go gomod filippo.io/age . `filippo.io/age/internal/format`/.DecodeStringscip-go gomod filippo.io/age . `filippo.io/age/internal/format`/DecodeString().(block.Argsscip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Args.[0]) |
| 169 | if err != nil { |
| 170 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("failed to parse X25519 recipient: %v", err) |
| 171 | } |
| 172 | if len(publicKey) != curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.PointSizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/PointSize. { |
| 173 | return nil, errorsscip-go gomod github.com/golang/go/src . errors/.Newscip-go gomod github.com/golang/go/src . errors/New().("invalid X25519 recipient block") |
| 174 | } |
| 175 | |
| 176 | sharedSecret, err := curve25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/.X25519scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/curve25519`/X25519().(i.secretKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#secretKey., publicKey) |
| 177 | if err != nil { |
| 178 | return nil, fmtscip-go gomod github.com/golang/go/src . fmt/.Errorfscip-go gomod github.com/golang/go/src . fmt/Errorf().("invalid X25519 recipient: %v", err) |
| 179 | } |
| 180 | |
| 181 | salt := make([]byte, 0, len(publicKey)+len(i.ourPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#ourPublicKey.)) |
| 182 | salt = append(salt, publicKey...) |
| 183 | salt = append(salt, i.ourPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#ourPublicKey....) |
| 184 | h := hkdfscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/hkdf`/.Newscip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/hkdf`/New().(sha256scip-go gomod github.com/golang/go/src . `crypto/sha256`/.Newscip-go gomod github.com/golang/go/src . `crypto/sha256`/New()., sharedSecret, salt, []byte(x25519Labelscip-go gomod filippo.io/age . `filippo.io/age`/x25519Label.)) |
| 185 | wrappingKey := make([]byte, chacha20poly1305scip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/chacha20poly1305`/.KeySizescip-go gomod golang.org/x/crypto v0.55.0 `golang.org/x/crypto/chacha20poly1305`/KeySize.) |
| 186 | if _, err := ioscip-go gomod github.com/golang/go/src . io/.ReadFullscip-go gomod github.com/golang/go/src . io/ReadFull().(h, wrappingKey); err != nil { |
| 187 | return nil, err |
| 188 | } |
| 189 | |
| 190 | fileKey, err := aeadDecryptscip-go gomod filippo.io/age . `filippo.io/age`/aeadDecrypt().(wrappingKey, fileKeySizescip-go gomod filippo.io/age . `filippo.io/age`/fileKeySize., block.Bodyscip-go gomod filippo.io/age . `filippo.io/age`/Stanza#Body.) |
| 191 | if err == errIncorrectCiphertextSizescip-go gomod filippo.io/age . `filippo.io/age`/errIncorrectCiphertextSize. { |
| 192 | return nil, errorsscip-go gomod github.com/golang/go/src . errors/.Newscip-go gomod github.com/golang/go/src . errors/New().("invalid X25519 recipient block: incorrect file key size") |
| 193 | } else if err != nil { |
| 194 | return nil, ErrIncorrectIdentityscip-go gomod filippo.io/age . `filippo.io/age`/ErrIncorrectIdentity. |
| 195 | } |
| 196 | return fileKey, nil |
| 197 | } |
| 198 | |
| 199 | // Recipient returns the public X25519Recipient value corresponding to i. |
| 200 | func (i *X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#) Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#Recipient().() *X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient# { |
| 201 | r := &X25519Recipientscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#{} |
| 202 | r.theirPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Recipient#theirPublicKey. = i.ourPublicKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#ourPublicKey. |
| 203 | return r |
| 204 | } |
| 205 | |
| 206 | // String returns the Bech32 private key encoding of i. |
| 207 | func (i *X25519Identityscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#) Stringscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#String().() string { |
| 208 | s, _ := bech32scip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/.Encodescip-go gomod filippo.io/age . `filippo.io/age/internal/bech32`/Encode().("AGE-SECRET-KEY-", i.secretKeyscip-go gomod filippo.io/age . `filippo.io/age`/X25519Identity#secretKey.) |
| 209 | return stringsscip-go gomod github.com/golang/go/src . strings/.ToUpperscip-go gomod github.com/golang/go/src . strings/ToUpper().(s) |
| 210 | } |