Skip to content

runtime error with golang master (furture go 1.22) #407

@LeGEC

Description

@LeGEC

in the golang repository, the stdlib package encoding/base64 received this commit:

golang/go@243c8c0

The base64.NewEncoding() function now checks explicitly for duplicate symbols in the alphabet input string.

It turns out that a hacky way to generate names in gen.go:

        genBase64enc  = base64.NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789__")

https://github.com/ugorji/go/blob/master/codec/gen.go#L193

uses a duplicate character (two _ characters at the end).

I don't know if the appropriate fix is to use another custom alphabet or use a base62 alphabet or use the RawStdEncoding and replace the unwanted characters,
but the current code will make any binary compiled with the gotip version fail as soon as started (this base64.NewEncoding() happens at init() time)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions