diff options
| author | Egon Elbre <egonelbre@gmail.com> | 2026-01-13 12:51:47 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-02-06 09:33:53 -0800 |
| commit | 2a8da3345a36148f4dca0cfb2b99cbe84ba9a50b (patch) | |
| tree | 669cb4011b06842042d19d6182d977cb4d204beb /internal/godoc/dochtml/testdata/order.go | |
| parent | d0bf40e3e777b94b6863e686523cb8cdc109b4f2 (diff) | |
| download | go-x-pkgsite-2a8da3345a36148f4dca0cfb2b99cbe84ba9a50b.tar.xz | |
internal/godoc/dochtml: use natural sorting for items
This ensures that simd/archsimd package items are sorted nicely.
For example:
"Uint8x64" < "Uint32x16" < "Uint64x8"
Fixes golang/go#77160
Change-Id: Ie08696262496e226120ae1b31ca81e02b7f20c65
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/736561
Auto-Submit: Sean Liao <sean@liao.dev>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ethan Lee <ethanalee@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'internal/godoc/dochtml/testdata/order.go')
| -rw-r--r-- | internal/godoc/dochtml/testdata/order.go | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/internal/godoc/dochtml/testdata/order.go b/internal/godoc/dochtml/testdata/order.go new file mode 100644 index 00000000..b8a82bfd --- /dev/null +++ b/internal/godoc/dochtml/testdata/order.go @@ -0,0 +1,55 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package order exercises natural sorting of symbols. +package order + +// Uint32x16 represents a 128-bit unsigned integer. +type Uint32x16 struct { + data [16]uint32 +} + +// AsUint8x64 converts a Uint32x16 to a Uint8x64. +func (u Uint32x16) AsUint8x64() Uint8x64 { + return Uint8x64{} +} + +// AsUint64x8 converts a Uint32x16 to a Uint64x8. +func (u Uint32x16) AsUint64x8() Uint8x64 { + return Uint64x8{} +} + +// Uint8x64 represents a 128-bit unsigned integer. +type Uint8x64 struct { + data [64]uint8 +} + +// AsUint32x16 converts a Uint8x64 to a Uint32x16. +func (u Uint8x64) AsUint32x16() Uint32x16 { + return Uint32x16{} +} + +// AsUint64x8 converts a Uint8x64 to a Uint64x8. +func (u Uint8x64) AsUint64x8() Uint64x8 { + return Uint64x8{} +} + +// Uint64x8 represents a 128-bit unsigned integer. +type Uint64x8 struct { + data [8]uint64 +} + +// AsUint8x64 converts a Uint64x8 to a Uint8x64. +func (u Uint64x8) AsUint8x64() Uint8x64 { + return Uint8x64{} +} + +// AsUint32x16 converts a Uint64x8 to a Uint32x16. +func (u Uint64x8) AsUint32x16() Uint32x16 { + return Uint32x16{} +} + +func ExampleUint64x8_AsUint32x16() {} + +func ExampleUint64x8_AsUint8x64() {} |
