Go (Golang) Tutorial #10 - Multiple Return Values

Go (Golang) Tutorial #10 - Multiple Return Values

Net Ninja

3 года назад

30,131 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@heismyke
@heismyke - 25.05.2024 00:47

i need a simple task on this

Ответить
@cockapockets
@cockapockets - 09.02.2024 18:36

this is why poeple use python omg how long winded is that lol

Ответить
@tavoochoa100
@tavoochoa100 - 30.12.2023 03:10

This language is not ready to be elegant and for fast development yet, too many things just to return two values, what a let down, I had more expectations...

Ответить
@coderke5650
@coderke5650 - 20.08.2022 18:07

It's always a bliss learning from the Alpha Ninja

Modified the getInitials func to return a single string of joined initials.

func getInitials(fullname string) string {
var nArr = strings.Split(strings.ToUpper(fullname), " ")
var inits []string
for _, value := range nArr {
inits = append(inits, value[:1])
}
return strings.Join(inits, ".")
}

Ответить
@navidmafi
@navidmafi - 18.11.2021 11:14

1- we cant store a multi return functions return in one value
2- how append works in action
3- handling different situations in return of a function
4- return of Split is unexpected and we cant set an explicit array for storing return of it

Ответить
@storylineteam
@storylineteam - 13.06.2021 20:35

is this a tuple, like c# etc?

Ответить
@964tractorboy
@964tractorboy - 03.06.2021 18:28

As in many languages, I can't help thinking the creators of Go tried hard to use a "different" syntax in several places just to be different.

Ответить
@farazk9729
@farazk9729 - 31.05.2021 00:44

Hi Shawn,

I am doing your Udemy course, and I am doing events there. Quick irrelevant question and I would appreciate it if you answered it:

What are handlers when it comes to events? I mean, I haven't heard you use the term "handler" yet, but anywhere I look online, the term is used a lot. Is it the event? Is the eventListener? Is it the block of code that fires once the event occurs? Or...?

Thanks a lot,
Faraz

Ответить
@bobbyutulu
@bobbyutulu - 29.05.2021 21:35

I'm really enjoying this, more Go videos please

Ответить
@Etheriiss
@Etheriiss - 29.05.2021 10:28

Hello Shaun, may I suggest course not precisely about programming language but about good practises? How to manage your files in slightly bigger projects, when and how split the code etc.? I think that would be life saver for a lot of people, give it a thought if you can, cheers :D

Ответить
@nickreutlinger
@nickreutlinger - 28.05.2021 22:51

Hey Net Ninja, please do more Flutter Tutorials! :)

Ответить
@samuelnatale2814
@samuelnatale2814 - 28.05.2021 20:57

Have you ever thought of doing a Swift series?

Ответить
@mxo3212
@mxo3212 - 28.05.2021 12:25

tnx for the consistency....

Ответить