Sign in

Fernandez Ludovic

@ldez.dev
163 followers 28 following 27 posts

I'm a community-funded open-source developer. Core maintainer of Golangci-lint, go-acme/lego, and some open-source projects you may be using 😉

PostsRepliesMedia
Fernandez Ludovic @ldez.dev · 07/01/2026
#FunWithAPIs This is the story of a boolean that can only be a integer.
ttl - bool - It can be set to the following values (number of seconds): 3600, 14400, 28800, 57600, 86400
000
Fernandez Ludovic @ldez.dev · 06/01/2026
#FunWithAPIs When an API is from the same family as Groot. What HTTP methods are you using? > I am POST! OK... Do you know GET, DELETE, PUT? > I am POST! OK, I will use POST.
POST List DNS Records
POST Add DNS Record
POST Update DNS Record
POST Delete DNS Record(s)
POST Reset Record
000
Fernandez Ludovic @ldez.dev · 25/04/2025
We often focus on binary size, but do you know the size of the files inside the module cache for your project? On a CI, this may lead you to "no space left on device" I created a small tool to calculate module cache size for a module. github.com/ldez/gomodca... #golang
000
Fernandez Ludovic @ldez.dev · 09/12/2024
🤔 maybe It works but it need to be uploaded with video button.
010
Fernandez Ludovic @ldez.dev · 09/12/2024
I missed that gif doesn't work on Bluesky
run with
100
Fernandez Ludovic @ldez.dev · 09/12/2024
Bonus: this linter is go1.24 ready ✨
linters:
  enable:
    - usetesting

linters-settings:
  usetesting:
    # Detects usage of `os.Chdir()`
    # Disabled if Go < 1.24.
    os-chdir: true

    # Detects usage of `context.Background()`
    # Disabled if Go < 1.24.
    context-background: true

    # Detects usage of `context.TODO()`
    # Disabled if Go < 1.24.
    context-todo: true
100
Fernandez Ludovic @ldez.dev · 09/12/2024
I created a new linter to detect calls which can be replaced by methods from the testing package. github.com/ldez/usetest... This new linter will be available in the next version of golangci-lint (v1.63). Support my work: bento.me/ldez #golang #golangcilint
> ./golangci-lint run example_test.go:41:18: os.CreateTemp("", ...) could be replaced by os.CreateTemp(t.TempDir(), ...) in TestSample (usetesting) tmpFile, err := os.CreateTemp("", pattern) example_test.go:46:17: os.MkdirTemp() could be replaced by t.TempDir() in TestSample (usetesting) tmpDir, err := os.MkdirTemp("", pattern) example_test.go:51:17: os.TempDir() could be replaced by t.TempDir() in TestSample (usetesting) otherTmpDir := os.TempDir() > linters:
  enable:
    - usetesting

linters-settings:
  usetesting:
    # Detects usage of `os.CreateTemp("", ...)`
    os-create-temp: true

    # Detects usage of `os.MkdirTemp()`
    os-mkdir-temp: true

    # Detects usage of `os.TempDir()`
    os-temp-dir: true
162
Fernandez Ludovic @ldez.dev · 04/12/2024
I added an option to the `gomoddirectives` linter: it forces the usage of patch 0 (ex: 1.22.0) or go family (ex 1.22) as min go version. github.com/ldez/gomoddi... This feature will be available in the next version of golangci-lint (v1.63). Support my work: bento.me/ldez #golang #golangcilint
> go mod edit -go=1.22
> ./golangci-lint run
go.mod:3:1: go directive (1.22) doesn't match the pattern '\d\.\d+\.0$' (gomoddirectives) go 1.22
> go mod edit -go=1.22.3
> ./golangci-lint run
go.mod:3:1: go directive (1.22.3) doesn't match the pattern '\d\.\d+\.0$' (gomoddirectives) go 1.22.3
> go mod edit -go=1.22.0
> ./golangci-lint runlinters:
  enable:
    - gomoddirectives

linters-settings:
  gomoddirectives:
    # Defines a pattern to validate `go` directive.
    go-version-pattern: '\d\.\d+\.0$'
022
Fernandez Ludovic @ldez.dev · 03/12/2024
I updated `tagliatelle` linter, you can now define the naming rules of struct tags by package. github.com/ldez/tagliat... This new feature will be available in the next version of golangci-lint (v1.63). Sponsor my work: bento.me/ldez #golang #golangcilint
Output of the golangci-lint commandExample of linter configuration:

linters:
  enable:
    - tagliatelle

linters-settings:
  tagliatelle:
    case:
      rules:
        json: camel
      overrides:
        # Ignore a package.
        - pkg: my/pkg
          ignore: true
        # Use different rules by package.
        - pkg: my/otherpkg
          rules:
            json: snake
001