Skip to content

Commit

Permalink
Use gofumpt to format code
Browse files Browse the repository at this point in the history
Brought to you by gofumpt v0.6.0 (go1.22.4).

Add a CI action to check code is gofumpt'ed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Jul 30, 2024
1 parent 6e3327a commit cf3b5c1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ linters:
enable:
- unconvert
- unparam
- gofumpt
48 changes: 24 additions & 24 deletions capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ type Capabilities interface {
//
// Deprecated: Replace with NewPid2. For example, replace:
//
// c, err := NewPid(0)
// if err != nil {
// return err
// }
// c, err := NewPid(0)
// if err != nil {
// return err
// }
//
// with:
//
// c, err := NewPid2(0)
// if err != nil {
// return err
// }
// err = c.Load()
// if err != nil {
// return err
// }
// c, err := NewPid2(0)
// if err != nil {
// return err
// }
// err = c.Load()
// if err != nil {
// return err
// }
func NewPid(pid int) (Capabilities, error) {
c, err := newPid(pid)
if err != nil {
Expand All @@ -101,21 +101,21 @@ func NewPid2(pid int) (Capabilities, error) {
//
// Deprecated: Replace with NewFile2. For example, replace:
//
// c, err := NewFile(path)
// if err != nil {
// return err
// }
// c, err := NewFile(path)
// if err != nil {
// return err
// }
//
// with:
//
// c, err := NewFile2(path)
// if err != nil {
// return err
// }
// err = c.Load()
// if err != nil {
// return err
// }
// c, err := NewFile2(path)
// if err != nil {
// return err
// }
// err = c.Load()
// if err != nil {
// return err
// }
func NewFile(path string) (Capabilities, error) {
c, err := newFile(path)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions enumgen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
"strings"
)

const fileName = "enum.go"
const genName = "enum_gen.go"
const (
fileName = "enum.go"
genName = "enum_gen.go"
)

type generator struct {
buf bytes.Buffer
Expand Down
4 changes: 1 addition & 3 deletions syscall_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ type vfscapData struct {
version int8
}

var (
_vfsXattrName *byte
)
var _vfsXattrName *byte

func init() {
_vfsXattrName, _ = syscall.BytePtrFromString(vfsXattrName)
Expand Down

0 comments on commit cf3b5c1

Please sign in to comment.