You do not have to.
use GenServer
actually injects code that contains @behaviour GenServer
as well with some boilerplate code (eg. child_spec/1
).
The module attribute (not macro) @behaviour
does only associate a behaviour to the module, while use
injects code at the place it is used, which may or may not add a behaviour to the module.