Skip to content
  • Eric Blake's avatar
    golang: Use 'gofmt' style recommendations on manual files · 2dcb7002
    Eric Blake authored
    
    
    After a couple of preliminary patches, a run of:
      gofmt -s -w $(git ls-files -- '**/*.go')
    
    produces only changes to whitespace (consistent use of TAB, better
    whitespace around operators, columnar alignment in lists), preferred
    ordering for imports, and eliding excess syntax (unneeded '()' or
    ';'), at least for my version of gofmt (Fedora's
    golang-bin-1.20.6-1.fc38).
    
    This fixes all .go files directly in git control.  Later patches will
    tackle (most) Go style problems in the generated files, and automate
    ways to ensure we don't regress (that automation may cause fallout
    where other versions of Go are differently picky; if that happens,
    we'll follow ideas learned from libvirt when they automated gofmt as
    part of their CI).
    
    Signed-off-by: Eric Blake's avatarEric Blake <eblake@redhat.com>
    Message-ID: <20230726175027.856419-2-eblake@redhat.com>
    [eblake: Split 590 and 620 changes into earlier patches]
    Acked-by: default avatarLaszlo Ersek <lersek@redhat.com>
    2dcb7002