dailygolangquiz's profile picture. Daily Go quiz, by @fmtprintf.

DailyGolangQuiz

@dailygolangquiz

Daily Go quiz, by @fmtprintf.

Happy New Year! Let it bring interesting problems to solve, new technologies to play with and new friends. Happy coding and talking!


Hi followers! I do apologise - during the Christmas time it is complicated to find time to update quiz daily. Expect irregular updates.


In #golang, how to check that date is valid? For example, 21/02/2015 is correct, but 31/02/2015 does not.


Which package should be used when dealing with #go code structure? For example, you can list all the file functions with it.


#go #golang which environment variables should be set in order to start working on the project?


Which #golang command formats Go source files? Does it simplify development in your team? Why?


#golang What is the default concurrency of tests in #go? Parallel? Sequential? How to change it?


#go #golang What is redundant in the code below? tpl, err := templates.Parse(text) if err != nil { log.Fatal(err) return }


#go #golang allows to call either `v:=..` or `v,ok:=..` while reading from map. Similar check can be used with ... (name at least two more)


#go #golang What should be instead of ***? var s *** s.Add(2) go func(){... s.Done()} go func(){... s.Done()} s.Wait()


#go Which #golang data structure supports removing minimum-valued element and adding elements in O(log(n))?


DailyGolangQuiz 님이 재게시함

@twitter #twitter or dear... hearts are awesome but not for everyone/everything.

fmtprintf's tweet image. @twitter #twitter or dear... hearts are awesome but not for everyone/everything.

@nodirtz Yes, it works on linux/mac, but on windows it fails with "The process cannot access the file...".


#go #golang why it is incorrect and does it work for you? f,_:=os.Create("hi") defer f.Close() … f.write([]byte{"world"}) … os.Remove("hi")


#go #golang Try to delete file with os.Remove on windows and mac/linux. Now make it readonly and try again. What is the difference?


#go #golang What should be used to do cross-platform path operations? How to get file name in the cross-platform way?


#go #golang what will happen if OS is Windows? If Mac/Linux? How to make it right? ioutil.WriteFile("HI\\THERE.TXT", []byte("WOW"), 0644)


#go #golang Why it is bad and what is correct pattern? ioutil.WriteFile("Hi.txt", []byte("Bill"), 0644) … d, _ := ioutil.ReadFile("hi.txt")


#go #golang Thank you for participating last week! This is week is about xplatform issues. Hope you will enjoy it.

dailygolangquiz's tweet image. #go #golang Thank you for participating last week! This is week is about xplatform issues. Hope you will enjoy it.

Loading...

Something went wrong.


Something went wrong.