Score:-2

Golang: timestamp add not working

cn flag

the task is this, I need to add 5 minutes to the timestamp, but whatever I do, the time does not change, what am I doing wrong?

Example: https://play.golang.org/p/AavonfZk2bn

Score:-1
th flag

The call to parse.Add at line 12 in your example should be changed to something like:

parse=parse.Add(5 * time.Minute)

the .Add method doesn't alter the time struct in place, it returns a new struct with the duration added which your original example was throwing away.

See this GO webiste for a quick example:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.