I cannot speak for the community, only for myself.
I like to use NounVerb combinations that make sense with the package name.
package.NounVerb()
handles.HelloSend()
I can then define the interface as VerbEr
type HelloSender interface {
HelloSend()
}
My son spent too many years using Java and tends to use Java style names,
it is important that you maintain a consistent style with your programming
team members. If you are not part of a team, you should join a team.
On Tuesday, August 7, 2018 at 7:29:41 AM UTC-5, Tong Sun wrote:
>
> Hi,
>
> Consider this function:
>
> b.Handle("/hello", func(m *tb.Message) {
> b.Send(m.Sender, "hello world")
> })
>
>
> I tried to refactor the above function to func sayHi(m *tb.Message)
> {...}, so that I can give an alias to the above /hello command (say to
> define a /hi command), but found that I cannot use bwithin it any more.
>
> So, how to refactor out this function?
>
> thx
>
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.