Skip to content

strings: HasSuffix doesn't work correctly for multibyte runes in go 1.26 #77613

Description

@hauntedness

Go version

Go 1.26

Output of go env in your module/workspace:

NA

What did you do?

https://go.dev/play/p/TUJbmwO_Op3?v=gotip

// You can edit this code!
// Click here and start typing.
package main

import (
	"fmt"
	"strings"
)

func main() {
	fmt.Println(strings.HasSuffix("木瓜太香", "太香"))
}

What did you see happen?

I don't have a pc to verify for now. Someone shared this behavior,
And I can reproduce it on go playground

What did you expect to see?

true same as go 1.25

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugReportIssues describing a possible bug in the Go implementation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.NeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions