Of course. But you have all that you need. If on these step something not clear better do one step back and do it again. If task don’t go forward - split it. Forget about callback, write your function separately.
Ok. Thanks. Trying.
For some reason, when I format https://play.golang.org/p/eLMByqpfbLt it puts spaces between 40, and 000 in 40,000. Why is it doing that! https://play.golang.org/p/-bFAmPjZxdq
Because Go doesn’t know about seperators in numbers. You have to write them as
Some languages like ruby, elixir or rust do allow to use
_ as a separator.
, in go is used to separate expressions/variables in multivalue returns/assigns, so basically go thinks you want to have
40 for the first and
000 for the second part of the assignment, thats why on a “Run” you will see errors about missing variables in multi-assignment:
prog.go:15:4: assignment mismatch: 1 variable but 2 values
What are return your function and what it’s must return?
Sorry that I’ve been out of the loop.
My dad passed away on Saturday night.
Mother’s Day was Sunday
My birthday was Monday
Lots of mixed emotions
This is the information I have concerning a return:
Returning a Func
You can return a func from a func . Here is what that looks like.
- returning a string
- returning a func
- step 1: https://play.golang.org/p/3Xk0wLFre8
- step 2 - cleaned up: https://play.golang.org/p/NocmYezUP2
- step 3 - cleaned up: https://play.golang.org/p/FSjvOfY0wW
- step 4 - cleaned up: https://play.golang.org/p/7wbv9KNlhK
- step 5 - cleaned up: https://play.golang.org/p/vW0IGeIAox
I’ll put my attention on the last one, since I understand the rest. I also understand this one. I want to attempt to apply it.
I’m a little lost.
What I want to do is start at 2019 at 40000 and then increase by 1000 each year and print that