go - How to use OR operator properly in Golang -


How can I do this simple in Goalge

  var planDate string date, ok: = Data ["date of appointment"] if! Ok {date of appointment = use Timestamp ()} and {planningDate = date}  

thanx

I do not see any way to do this in the same line, because there is no one in you | can not be used, either the operands numbers are not. However, here is a solution in three rows (assuming: date is only a temporary variable):

  date of appointment, ok: = data ["planning Date "] if! OK {PlanDate = util.TimeStamp ()}  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -