Skip to content

Commit b8bbe24

Browse files
authored
Merge branch 'golang:master' into master
2 parents 86e764d + e5eee40 commit b8bbe24

18 files changed

+41
-24
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: gomod
9+
directory: /
10+
schedule:
11+
interval: daily

.github/workflows/go.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,23 @@ on:
99
pull_request:
1010
branches: [ "master" ]
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316

1417
build:
1518
runs-on: ubuntu-latest
1619
steps:
17-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1821

1922
- name: Set up Go
20-
uses: actions/setup-go@v5
23+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2124
with:
22-
go-version-file: 'go.mod'
25+
# TODO: enable [matrix testing](https://github.com/marketplace/actions/setup-go-environment#matrix-testing)
26+
# so that we can test on both stable, oldstable and the oldest version
27+
# we currently support (as specified in go.mod).
28+
go-version: 'stable'
2329

2430
- name: Build
2531
run: go build -v ./...

.github/workflows/scorecard.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6565
# format to the repository Actions tab.
6666
- name: "Upload artifact"
67-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
67+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6868
with:
6969
name: SARIF file
7070
path: results.sarif
@@ -73,6 +73,6 @@ jobs:
7373
# Upload the results to GitHub's code scanning dashboard (optional).
7474
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7575
- name: "Upload to code-scanning"
76-
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3
76+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
7777
with:
7878
sarif_file: results.sarif

s2/builder_snapper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (sf CellIDSnapper) SnapPoint(point Point) Point {
348348
}
349349

350350
const (
351-
// The minum exponent supported for snapping.
351+
// The minimum exponent supported for snapping.
352352
minIntSnappingExponent = 0
353353
// The maximum exponent supported for snapping.
354354
maxIntSnappingExponent = 10

s2/cell.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (c Cell) VertexRaw(k int) Point {
124124
return Point{faceUVToXYZ(int(c.face), c.uv.Vertices()[k].X, c.uv.Vertices()[k].Y)}
125125
}
126126

127-
// Edge returns the nomalized inward-facing normal of the great circle passing through
127+
// Edge returns the normalized inward-facing normal of the great circle passing through
128128
// the CCW ordered edge from vertex k to vertex k+1 (mod 4) (for k = 0,1,2,3)
129129
func (c Cell) Edge(k int) Point {
130130
return Point{c.EdgeRaw(k).Normalize()}

s2/edge_crossings.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func intersectionStableSorted(a0, a1, b0, b1 Point) (Point, bool) {
367367
// is not guaranteed to have the correct sign (i.e., the return value may need
368368
// to be negated).
369369
func intersectionExact(a0, a1, b0, b1 Point) Point {
370-
// Since we are using presice arithmetic, we don't need to worry about
370+
// Since we are using precise arithmetic, we don't need to worry about
371371
// numerical stability.
372372
a0P := r3.PreciseVectorFromVector(a0.Vector)
373373
a1P := r3.PreciseVectorFromVector(a1.Vector)

s2/lexicon.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (l *sequenceLexicon) size() int {
149149
return len(l.begins) - 1
150150
}
151151

152-
// hash returns a hash of this sequence of int32s.
152+
// hashSet returns a hash of this sequence of int32s.
153153
func hashSet(s []int32) uint32 {
154154
// TODO(roberts): We just need a way to nicely hash all the values down to
155155
// a 32-bit value. To ensure no unnecessary dependencies we use the core

s2/pointcompression.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func stToPiQi(s float64, level uint) uint32 {
300300
return uint32(s * float64(int(1)<<level))
301301
}
302302

303-
// siTiToPiQi returns the value transformed into the PiQi coordinate spade.
303+
// siTitoPiQi returns the value transformed into the PiQi coordinate spade.
304304
// encodeFirstPointFixedLength encodes the return value using level bits,
305305
// so we clamp si to the range [0, 2**level - 1] before trying to encode
306306
// it. This is okay because if si == maxSiTi, then it is not a cell center

s2/polyline_alignment.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type columnStride struct {
9797
end int
9898
}
9999

100-
// inRange reports if the given index is in range of this stride.
100+
// InRange reports if the given index is in range of this stride.
101101
func (c columnStride) InRange(index int) bool {
102102
return c.start <= index && index < c.end
103103
}
@@ -235,7 +235,7 @@ func (w *window) checkedColumnStride(row int) columnStride {
235235
return w.strides[row]
236236
}
237237

238-
// upscale returns a new, larger window that is an upscaled version of this window.
238+
// upsample returns a new, larger window that is an upscaled version of this window.
239239
//
240240
// Used by ApproximateAlignment window expansion step.
241241
func (w *window) upsample(newRows, newCols int) *window {
@@ -402,7 +402,7 @@ func ExactVertexAlignmentCost(a, b *Polyline) float64 {
402402
return cost[len(cost)-1]
403403
}
404404

405-
// GetExactVertexAlignment takes two non-empty polylines as input, and returns
405+
// ExactVertexAlignment takes two non-empty polylines as input, and returns
406406
// the VertexAlignment corresponding to the optimal alignment between them. This
407407
// method is quadratic O(A*B) in both space and time complexity.
408408
func ExactVertexAlignment(a, b *Polyline) *vertexAlignment {

s2/polyline_alignment_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,4 +448,4 @@ func TestPolylineAlignmentExactAlignmentCost(t *testing.T) {
448448

449449
// TODO()rsned): Differences from C++
450450
// Medoid tests
451-
// Consensus testss
451+
// Consensus tests

s2/polyline_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestPolylineBasics(t *testing.T) {
3333
}
3434
empty.Reverse()
3535
if len(empty) != 0 {
36-
t.Errorf("reveresed empty Polyline should have no vertices")
36+
t.Errorf("reversed empty Polyline should have no vertices")
3737
}
3838

3939
latlngs := []LatLng{

s2/predicates.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func precSub(a, b *big.Float) *big.Float {
123123
return new(big.Float).SetPrec(big.MaxPrec).Sub(a, b)
124124
}
125125

126-
// precSub is a helper to wrap the boilerplate of multiplying two big.Floats.
126+
// precMul is a helper to wrap the boilerplate of multiplying two big.Floats.
127127
func precMul(a, b *big.Float) *big.Float {
128128
return new(big.Float).SetPrec(big.MaxPrec).Mul(a, b)
129129
}

s2/predicates_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ func testCompareDistancesConsistency(t *testing.T, x, a, b Point, distFunc compa
886886
}
887887

888888
// choosePointNearPlaneOrAxes returns a random Point that is often near the
889-
// intersection of one of the coodinates planes or coordinate axes with the unit
889+
// intersection of one of the coordinates planes or coordinate axes with the unit
890890
// sphere. (It is possible to represent very small perturbations near such points.)
891891
func choosePointNearPlaneOrAxes() Point {
892892
p := randomPoint()
@@ -1042,7 +1042,7 @@ func TestPredicatesSignDotProd(t *testing.T) {
10421042
for _, test := range tests {
10431043
got := SignDotProd(test.a, test.b)
10441044
if got != test.want {
1045-
t.Errorf("SignDotProd(%+v, %+v) = %d, wnat %d", test.a, test.b, got, test.want)
1045+
t.Errorf("SignDotProd(%+v, %+v) = %d, want %d", test.a, test.b, got, test.want)
10461046
}
10471047

10481048
gotPrec := "EXACT"

s2/query_entry_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func TestQueryQueueEntry(t *testing.T) {
7171
t.Errorf("number of elements different: got %d, want %d", got, want)
7272
}
7373

74-
// Take the items out and verfy the queue has them in the preferred order.
74+
// Take the items out and verify the queue has them in the preferred order.
7575
for i, cid := range expectedCellIDs {
7676
item := q.pop()
7777
if item.id != cid {

s2/s2intersect/s2intersect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func cellUnionToIntervalLimits(cu s2.CellUnion, idx int) []*limit {
232232

233233
// collapseLimits returns a slice of limits such that all of those of the same
234234
// type at the same leaf CellID are grouped with their indices in the same
235-
// slice. The returned slice will be sorted by CellID and tyoe,
235+
// slice. The returned slice will be sorted by CellID and type,
236236
//
237237
// e.g. {leaf(x),start,indices[2]} and {leaf(x),start,indices[7]} will become
238238
// {leaf(x),start,indices[2,7]}.

s2/shape.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ type Shape interface {
193193
// Chain(i).start + Chain(i).length == NumEdges(), for i == NumChains()-1
194194
Chain(chainID int) Chain
195195

196-
// ChainEdgeReturns the edge at offset "offset" within edge chain "chainID".
196+
// ChainEdge returns the edge at offset "offset" within edge chain "chainID".
197197
// Equivalent to "shape.Edge(shape.Chain(chainID).start + offset)"
198198
// but more efficient.
199199
ChainEdge(chainID, offset int) Edge

s2/shapeindex.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ func (s *ShapeIndex) clipVBound(edge *clippedEdge, vEnd int, v float64) *clipped
13411341
return s.updateBound(edge, uEnd, u, vEnd, v)
13421342
}
13431343

1344-
// cliupVAxis returns the given edge clipped to within the boundaries of the middle
1344+
// clipVAxis returns the given edge clipped to within the boundaries of the middle
13451345
// interval along the v-axis, and adds the result to its children.
13461346
func (s *ShapeIndex) clipVAxis(edge *clippedEdge, middle r1.Interval) (a, b *clippedEdge) {
13471347
if edge.bound.Y.Hi <= middle.Lo {

s2/stuv.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ import (
9090
// (x, y, z)
9191
// Direction vector (Point). Direction vectors are not necessarily unit
9292
// length, and are often chosen to be points on the biunit cube
93-
// [-1,+1]x[-1,+1]x[-1,+1]. They can be be normalized to obtain the
93+
// [-1,+1]x[-1,+1]x[-1,+1]. They can be normalized to obtain the
9494
// corresponding point on the unit sphere.
9595
//
9696
// (lat, lng)
@@ -427,7 +427,7 @@ func uvwAxis(face, axis int) Point {
427427
return faceUVWAxes[face][axis]
428428
}
429429

430-
// uvwFaces returns the face in the (u,v,w) coordinate system on the given axis
430+
// uvwFace returns the face in the (u,v,w) coordinate system on the given axis
431431
// in the given direction.
432432
func uvwFace(face, axis, direction int) int {
433433
return faceUVWFaces[face][axis][direction]

0 commit comments

Comments
 (0)