Idiomatic way of entering logical predicate functions

Suppose you are working with func, which returns a bool regarding whether the user was active last month.

In Ruby:

def active_in_last_month?;end 

In c #

 public bool WasActiveInLastMonth(){} 

What is the idiomatic way of naming logical functions of a predicate in Go?

+8
go
source share
1 answer

Usually you setter with 'set'

 WasActiveInLastMonth() { return wasActiveInLastMonth } SetWasActiveInLastMonth(newVal bool) { wasActiveInLastMonth = newval } 

if you have a private field wasActiveInLastMonth

-one
source share

All Articles