When t == nil, no theme is selected, and this is the way to indicate that TERM=bot is set.
The logic is branched, and user.ID() is used in place of user.Name(). The text used in fmt.Sprintf is separated and could be lifted from the function and used as a constant instead to avoid repeated allocations if desired (if the Go compiler doesn't do that already in the build step).
In reference to #414.
When
t == nil
, no theme is selected, and this is the way to indicate thatTERM=bot
is set.The logic is branched, and
user.ID()
is used in place ofuser.Name()
. The text used infmt.Sprintf
is separated and could be lifted from the function and used as a constant instead to avoid repeated allocations if desired (if the Go compiler doesn't do that already in the build step).