Golang Tutorial #5 - Console Input (Bufio Scanner) & Type Conversion

preview_player
Показать описание
This golang tutorial covers how to get user input using the bufio scanner. This will show you how to get console input in go and also how to convert the input you get to your desired data type.

◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python

◾◾◾◾◾◾

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

⭐ Tags ⭐
- Tech With Tim
- Golang Tutorial
- Go Programming
- Scanner Golang
- Golang Console Input

⭐ Hashtags ⭐
#GO # Golang
Рекомендации по теме
Комментарии
Автор

Nice video!
One comment though. It is just my opinion though. For getting the input in golang, I most often use the bufio scanners. But as a beginner I found the fmt.Scan methods to be much more intuitive and having less syntax around it. So you don't have to take it, but my advice is when doing another beginner tutorial like this, and the focus is not on getting input, you could use the fmt.Scan method to make it more easy to follow.

That said, I think these methods require pointers so it really is just preference

kilianvounckx
Автор

Not a big fan of Go but I do enjoy the ideas you present. Nice vid my dude!

Chaynes
Автор

Thank you for your awesome videos!
I'll write Master thesis about the possible fields of application for predictive analysis in the controlling departments of companies. Thanks to your really well explained videos im fairly convinced that I'll be able to add a chapter about an own analysis.

listigerlurch
Автор

Hi Tim, nice tutorial. I like the way you explain. This session was a bit hard to understand. So there seems to be several ways to scan from console input as comments shown. Could you give some more examples with pros and cons? Regards Andreas

heinzkreutziger
Автор

Thanks, Please give us as much as you can with Golang. I can't wait for List, maps, func.... Thanks

simajacob
Автор

Could also use bufio.NewReader() and fmt.Scan() then read from os.Stdin.

Phdz
Автор

keep going bro keep going
thanks for this tutorial

mohamadkenway
Автор

Hey Tim, are you using the golang extension in vscode? If yes, please tell me how did you disable format on save for go. I checked the vscode as well as the golang extension settings and tried disabling the "lint on save" and "build on save" options but with no luck :/

melvinlijiabraham
Автор

Nice video bro, maybe I'll look into golang

openjaws
Автор

What extensions do you use in vscode for golang? Im new in vscode.

xsendilien
Автор

Hey time, can you just prepare a cheat sheet for GoLang, it would be really helpfull.

vaibhavp
Автор

I suppose you use word "object" to be more intuitive but what exactly is "scanner" variable?

edtix
Автор

When I watched this video last year, I thought: what a stupid language that has so difficult implementation of such a simple task like input. But recently I returned to Go by another, better tutorial and learnt that there is a simple method 'fmt.Scanln (&variable_name)'.

Sergey_Latyshev
Автор

Has the give away winner been chosen ?

mrpancakes
Автор

Hi bro! And how to make the function write the number for each digit into the map? For example, input: 12334. Output: 1: 1; 2: 1; 3: 2; 4: 1. On Golang

BrooklynDesigne
Автор

i want asking to you. How about atribut strconv.ParseInt can be defined with result 10 and 64. What is that ASCII in your mind?

akhmadfaizal
Автор

Why not just do something like:
var year_born int
fmt.Print(“what year were your born: “)
fmt.Scan(&year_born)
result := 2020 - year_born
fmt.Println(result)


The whole scanner thing just seems extra, or did I miss something?

engageintellect
Автор

Do you have any tutorial for go fiber framework?!

mohammadhonarvar
Автор

Hi Tim, I had one doubt
When I run fmt.Println(*os.Stdin) it prints a memory address like this {0xc000182000}
What does it signify and how does it work?

umangagrawal
Автор

What is different between bufio and fmt.Scanln ?

aayamshrestha