Skip to content

Commit 8e5c456

Browse files
committed
convert golang scan-input to md
1 parent 6cf14ec commit 8e5c456

File tree

3 files changed

+20
-49
lines changed

3 files changed

+20
-49
lines changed

golang/naming.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@
5757

5858
- What's in a name? [video](https://youtu.be/sFUSP8Au_PE).
5959
- [Variables by ArdanLabs](https://github.com/ardanlabs/gotraining/blob/master/topics/go/language/variables/README.md#links)
60+
- [CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments)
6061

golang/scan-input.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Scan Input from STDIN
2+
3+
* Taking in input from command line
4+
5+
```go
6+
var name string
7+
fmt.Scanf("%s", &name)
8+
```
9+
10+
**Note**: Above method is super simple, we cannot scan lines using above.
11+
12+
* Scan lines
13+
14+
```go
15+
scanner := bufio.NewScanner(os.Stdin)
16+
scanner.Scan()
17+
line := scanner.Text()
18+
fmt.Println(line)
19+
```

golang/scan_input.ipynb

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)