DailyGolangQuiz
@dailygolangquiz
Daily Go quiz, by @fmtprintf.
Potrebbero piacerti
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.
#golang Today's challenge is from @davecheney: dave.cheney.net/2015/11/18/wed… - Can you see a data race?
Which #golang command formats Go source files? Does it simplify development in your team? Why?
#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))?
@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")
United States Tendenze
- 1. Dodgers 637K posts
- 2. #WorldSeries 309K posts
- 3. Yamamoto 195K posts
- 4. Blue Jays 142K posts
- 5. Will Smith 46.3K posts
- 6. Miguel Rojas 39.7K posts
- 7. Kershaw 30.2K posts
- 8. Yankees 14.8K posts
- 9. Baseball 156K posts
- 10. Dave Roberts 12.2K posts
- 11. Vladdy 21.3K posts
- 12. Kendrick 16.3K posts
- 13. Ohtani 83.2K posts
- 14. #Worlds2025 26.5K posts
- 15. Jeff Hoffman 3,485 posts
- 16. Auburn 14.2K posts
- 17. Nike 34.8K posts
- 18. Cubs 7,435 posts
- 19. Phillies 3,463 posts
- 20. Miggy 8,118 posts
Potrebbero piacerti
-
Alexandre Ruban
@alexandre_ruban -
GopherConIndia
@GopherConIndia -
YouTrack by JetBrains
@youtrack -
James Bridger
@jcjbridger -
Peter Kieltyka
@peterk -
Stella Miranda
@fashionate -
GopherCon UK
@gopherconuk -
Gani Mendoza
@ibm2100 -
Tommy Leung
@supertommyleung -
Sameer Sortur
@SameerSortur -
Adam Pohorecki 🇺🇦💙💛
@apohorecki
Something went wrong.
Something went wrong.