Skip to content

Commit 817ec0a

Browse files
committed
Fix some godoc comments
1 parent e021036 commit 817ec0a

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

ipieces/ipieces.go

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
// Package ipieces allows users to create IP address-based Geocaching puzzles.
22
//
3-
// To create a puzzle, you need to populate a [Puzzle] struct and call [Run] on it.
3+
// To create a puzzle, you need to populate a [Puzzle] struct and call [Puzzle.Run] on it.
44
// For example:
55
//
6-
// package main
6+
// package main
77
//
8-
// import (
9-
// "github.com/bitlux/caches/ipieces"
10-
// "github.com/bitlux/vpnapi"
11-
// )
8+
// import (
9+
// "github.com/bitlux/caches/ipieces"
10+
// "github.com/bitlux/vpnapi"
11+
// )
1212
//
13-
// func main() {
14-
// p := ipieces.Puzzle{
15-
// Final: []ipieces.Digit{
16-
// ipieces.Digit{Value: "3", Status: ipieces.VISIBLE}
17-
// ipieces.Digit{Value: "7", Status: ipieces.VISIBLE}
18-
// ipieces.Digit{Value: "2", Status: ipieces.VISIBLE}
19-
// ipieces.Digit{Value: "4", Status: ipieces.HIDDEN}
20-
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
21-
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
22-
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
23-
// ipieces.Digit{Value: "1", Status: ipieces.VISIBLE}
24-
// ipieces.Digit{Value: "2", Status: ipieces.VISIBLE}
25-
// ipieces.Digit{Value: "2", Status: ipieces.VISIBLE}
26-
// ipieces.Digit{Value: "0", Status: ipieces.VISIBLE}
27-
// ipieces.Digit{Value: "4", Status: ipieces.HIDDEN}
28-
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
29-
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
30-
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
31-
// },
32-
// IndexFunc: func(b [sha256.Size]byte) int {
33-
// return int(b[sha256.Size-1]) % 8
34-
// },
35-
// // Setting Client is optional.
36-
// Client: vpnapi.New("YOUR-API-KEY-HERE"),
37-
// Backdoor: "topsecret",
38-
// GCCode: "GCB2PKC",
39-
// }
40-
// p.Run()
41-
// }
13+
// func main() {
14+
// p := ipieces.Puzzle{
15+
// Final: []ipieces.Digit{
16+
// ipieces.Digit{Value: "3", Status: ipieces.VISIBLE}
17+
// ipieces.Digit{Value: "7", Status: ipieces.VISIBLE}
18+
// ipieces.Digit{Value: "2", Status: ipieces.VISIBLE}
19+
// ipieces.Digit{Value: "4", Status: ipieces.HIDDEN}
20+
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
21+
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
22+
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
23+
// ipieces.Digit{Value: "1", Status: ipieces.VISIBLE}
24+
// ipieces.Digit{Value: "2", Status: ipieces.VISIBLE}
25+
// ipieces.Digit{Value: "2", Status: ipieces.VISIBLE}
26+
// ipieces.Digit{Value: "0", Status: ipieces.VISIBLE}
27+
// ipieces.Digit{Value: "4", Status: ipieces.HIDDEN}
28+
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
29+
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
30+
// ipieces.Digit{Value: "0", Status: ipieces.HIDDEN}
31+
// },
32+
// IndexFunc: func(b [sha256.Size]byte) int {
33+
// return int(b[sha256.Size-1]) % 8
34+
// },
35+
// // Setting Client is optional.
36+
// Client: vpnapi.New("YOUR-API-KEY-HERE"),
37+
// Backdoor: "topsecret",
38+
// GCCode: "GCB2PKC",
39+
// }
40+
// p.Run()
41+
// }
4242
//
43-
// [Run] creates two handlers:
43+
// [Puzzle.Run] creates two handlers:
4444
// - a text endpoint at `/text` which responds with a short plaintext page with the client's IP,
4545
// the computed index into the final coordinates, and the revealed coordinate, and
4646
// - a default endpoint, which serves any path other than `/text`, and responds with an HTML page.

0 commit comments

Comments
 (0)