File tree 1 file changed +19
-8
lines changed
1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
1
# Samples
2
2
3
3
Please play with the samples by editing them and running the main files:
4
- - ` main.go ` just a starter for different playgrounds
5
- - ` main-play.go ` general playground based on CopyFile and recursion
6
- - ` main-db-sample.go ` simulates DB transaction and money transfer
4
+ - ` main.go ` just a starter for different playgrounds (includes ` asserter ` tester)
5
+ - ` main-play.go ` general playground based on ` CopyFile ` and recursion
6
+ - ` main-db-sample.go ` simulates DB transaction with money transfer
7
7
- ` main-nil.go ` samples and tests for logger and using ` err2.Handle ` for success
8
8
9
9
Run a default playground ` play ` mode:
10
10
``` go
11
- go run ./...
11
+ go run .
12
12
```
13
13
14
- Or run the DB based version to maybe better understand how powerful the
15
- automatic error string building is:
14
+ > [ !TIP]
15
+ > Set a proper alias to play with samples:
16
+ > ``` sh
17
+ > alias sa=' go run .'
18
+ > ` ` `
19
+
20
+ Run the DB based version to maybe better understand how powerful the automatic
21
+ error string building is:
22
+
16
23
` ` ` go
17
- go run ./... -mode db
24
+ sa -mode db
25
+ # or
26
+ go run . -mode db
18
27
```
19
28
20
29
You can print usage:
21
30
``` go
22
- go run ./... -h
31
+ sa -h
32
+ # or
33
+ go run . -h
23
34
```
You can’t perform that action at this time.
0 commit comments