Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: rendering < sign incorrectly in examples #46424

Closed
codyoss opened this issue May 27, 2021 · 2 comments
Closed

x/pkgsite: rendering < sign incorrectly in examples #46424

codyoss opened this issue May 27, 2021 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@codyoss
Copy link
Member

codyoss commented May 27, 2021

What did you do?

Went to https://pkg.go.dev/sort#example-Slice

What did you expect to see?

A working example I could copy and paste.

What did you see instead?

See link, but:

package main

import (
	"fmt"
	"sort"
)

func main() {
	people := []struct {
		Name string
		Age  int
	}{
		{"Gopher", 7},
		{"Alice", 55},
		{"Vera", 24},
		{"Bob", 75},
	}
	sort.Slice(people, func(i, j int) bool { return people[i].Name &lt; people[j].Name })
	fmt.Println("By name:", people)

	sort.Slice(people, func(i, j int) bool { return people[i].Age &lt; people[j].Age })
	fmt.Println("By age:", people)

Notice the &lt;

Extra details:

  • User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
@gopherbot gopherbot added this to the Unreleased milestone May 27, 2021
@gopherbot
Copy link

Change https://golang.org/cl/323549 mentions this issue: content: fix incorrect rendering code in examples

@AlekSi
Copy link
Contributor

AlekSi commented May 30, 2021

The same problem with &

@jba jba added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 1, 2021
@jba jba modified the milestones: Unreleased, pkgsite/unplanned Jun 1, 2021
@golang golang locked and limited conversation to collaborators Jun 1, 2022
@rsc rsc unassigned jamalc Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants