Skip to content

Commit c8d7354

Browse files
authored
golang
1 parent f93c682 commit c8d7354

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

_til/codestyle/golang.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Go
3+
category: codestyle
4+
---
5+
6+
__Go__ (just use a linter basically):
7+
```go
8+
//Function Signatures:
9+
func foo(arg1: int, arg2: bool) {
10+
11+
//if/else
12+
if x == y {
13+
return x
14+
}
15+
return y
16+
17+
//No non bracketed blocks
18+
//wrong:
19+
if x == 1
20+
return true
21+
//correct:
22+
if x == 1 {
23+
return true
24+
}
25+
```

0 commit comments

Comments
 (0)