-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon-abbreviations.go
47 lines (44 loc) · 1.4 KB
/
common-abbreviations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package variables
import "io"
// go does not encourage verbose code
// we gophers are lazy, I bet you are too
// thus instead of coming up with big ass names of variables
// we use short abbreviated names
// below are some examples used in go libraries
var (
s string // string
i int // int
num int // number
msg string // message
v string // value
val string // value
fv string // flag value
err string // error value
args []string // agruments
seen bool // has seen?
parsed bool // parsing ok?
buf []byte // buffer
off int // offeset
op int // operation
opRead int // read operation
l int // length
n int // number or number of
m int // another number
c int // capacity
ch rune // character
a []int // array
rr rune // rune
sep string // separator
src int // source
dst int // destination
b byte // byte
w io.Writer // writer
r io.Reader // reader
pos int // position
//... the list goes on and on
// you are not expected to remember all of them
// but you can always refer to the documentation
// or the source code of the library
// this is just to give you an idea of how common abbreviations are used
// this is just an example, you can use any name you want
)