profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/bombsimon/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Simon Sawert bombsimon @EmbarkStudios Stockholm, Sweden https://sawert.se

0x4b53/amqp-rpc 10

🐰 Framework to use RabbitMQ as RPC

bombsimon/det-blev-ingen-cd.com 8

💿 Source code for the web site

0x4b53/epp-go 4

EPP server and client written in Go

bombsimon/async-await-demo 1

Trying out async/.await

bombsimon/distcron 1

🗓 Run scheduled jobs in several instances but only run once!

bombsimon/dotfiles 1

💻 ...

bombsimon/elixir-nm 1

Nim implementation with Elixir

bombsimon/flickr-upload 1

Yet another API implementation

bombsimon/advent-of-code-2019 0

🎄Solutions to advent of code 2019

issue commentgolangci/golangci-lint

Cannot install golangci-lint from source on Go <= 1.15

@Idez @bombsimon Thanks to both of your for your patience and answers 👍 I have also put a proposal here: https://github.com/golangci/golangci-lint/issues/1657#issuecomment-839498111

pellared

comment created time in 33 minutes

issue commentgolangci/golangci-lint

A better way to install and run golangci-lint in a single command

What about installing golangci-lint using the new go install syntax like this:

go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.39.0

This way is (I believe) truly cross-platform and can be used e.g. like this: https://github.com/pellared/goyek-demo/blob/e51b9211be1155cbf1cca40d8f1eb392e6dda592/build/build.go#L41-L46

References

From: https://golang.org/ref/mod

Since Go 1.16, go install is the recommended command for building and installing programs. When used with a version suffix (like @latest or @v1.4.6), go install builds packages in module-aware mode, ignoring the go.mod file in the current directory or any parent directory, if there is one.

More:

  • https://golang.org/ref/mod#go-install
  • https://github.com/golang/go/issues/40276
  • https://github.com/golang/go/issues/43684
ysmood

comment created time in 38 minutes

issue commentgolangci/golangci-lint

not found

https://golangci-lint.run/usage/install/

Installation says go get is not guaranteed to work, please follow other methods

LucaPaterlini

comment created time in an hour

issue commentgolangci/golangci-lint

linter crashes with panic

@ldez I didn't see any comments on #1540 explaining current the behavior. Should I open a new issue or just comment on that issue? I generally prefer not to comment on closed issues. I updated golangci-lint on several repos today, only to find out that they don't do anything because they are invisibly panicking in the pre-commit hooks that run them, so the current behavior is kind of frustrating. Thanks.

gucio321

comment created time in 5 hours

issue commentgolangci/golangci-lint

linter crashes with panic

@ashanbrown more details in #1540

gucio321

comment created time in 6 hours

issue commentgolangci/golangci-lint

linter crashes with panic

@ldez Why is it desirable to have panics reported as warnings? Will it still run the other linters at least?

gucio321

comment created time in 6 hours

issue commentgolangci/golangci-lint

linter crashes with panic

The root cause is sigchanyzer but I still trying to understand why.

gucio321

comment created time in 7 hours

issue commentgolangci/golangci-lint

linter crashes with panic

What is more concerning is that when we panic, I'm still seeing an exit status code of 0.

It's expected because the panics are reported as a warning.

gucio321

comment created time in 7 hours

issue commentgolangci/golangci-lint

linter crashes with panic

It's related to nilness also, the important information is interface conversion: interface {} is nil, not *buildssa.SSA:

gucio321

comment created time in 8 hours

issue commentbombsimon/logrusr

BUG: log.WithName() is not threadsafe

Thanks you!

shaneutt

comment created time in 8 hours

issue commentgolangci/golangci-lint

linter crashes with panic

What is more concerning is that when we panic, I'm still seeing an exit status code of 0.

gucio321

comment created time in 8 hours

issue commentgolangci/golangci-lint

linter crashes with panic

I've also seen some other panics that seem to be fixed by not running gotvet. This one doesn't appear to be related to nilness (although removing that fixed a different panic):

gucio321

comment created time in 8 hours

PR opened bombsimon/pace-calculator

Bump hosted-git-info from 2.8.2 to 2.8.9

Bumps hosted-git-info from 2.8.2 to 2.8.9. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md">hosted-git-info's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9">2.8.9</a> (2021-04-07)</h2> <h3>Bug Fixes</h3> <ul> <li>backport regex fix from <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/76">#76</a> (<a href="https://github.com/npm/hosted-git-info/commit/29adfe5">29adfe5</a>), closes <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/84">#84</a></li> </ul> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8">2.8.8</a> (2020-02-29)</h2> <h3>Bug Fixes</h3> <ul> <li><a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/61">#61</a> & <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/65">#65</a> addressing issues w/ url.URL implmentation which regressed node 6 support (<a href="https://github.com/npm/hosted-git-info/commit/5038b18">5038b18</a>), closes <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/66">#66</a></li> </ul> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7">2.8.7</a> (2020-02-26)</h2> <h3>Bug Fixes</h3> <ul> <li>Do not attempt to use url.URL when unavailable (<a href="https://github.com/npm/hosted-git-info/commit/2d0bb66">2d0bb66</a>), closes <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/61">#61</a> <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/62">#62</a></li> <li>Do not pass scp-style URLs to the WhatWG url.URL (<a href="https://github.com/npm/hosted-git-info/commit/f2cdfcf">f2cdfcf</a>), closes <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/60">#60</a></li> </ul> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6">2.8.6</a> (2020-02-25)</h2> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5">2.8.5</a> (2019-10-07)</h2> <h3>Bug Fixes</h3> <ul> <li>updated pathmatch for gitlab (<a href="https://github.com/npm/hosted-git-info/commit/e8325b5">e8325b5</a>), closes <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/51">#51</a></li> <li>updated pathmatch for gitlab (<a href="https://github.com/npm/hosted-git-info/commit/ffe056f">ffe056f</a>)</li> </ul> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4">2.8.4</a> (2019-08-12)</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/npm/hosted-git-info/commit/8d4b3697d79bcd89cdb36d1db165e3696c783a01"><code>8d4b369</code></a> chore(release): 2.8.9</li> <li><a href="https://github.com/npm/hosted-git-info/commit/29adfe5ef789784c861b2cdeb15051ec2ba651a7"><code>29adfe5</code></a> fix: backport regex fix from <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/76">#76</a></li> <li><a href="https://github.com/npm/hosted-git-info/commit/afeaefdd86ba9bb5044be3c1554a666d007cf19a"><code>afeaefd</code></a> chore(release): 2.8.8</li> <li><a href="https://github.com/npm/hosted-git-info/commit/5038b1891a61ca3cd7453acbf85d7011fe0086bb"><code>5038b18</code></a> fix: <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/61">#61</a> & <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/65">#65</a> addressing issues w/ url.URL implmentation which regressed nod...</li> <li><a href="https://github.com/npm/hosted-git-info/commit/7440afa859162051c191e55d8ecfaf69a193b026"><code>7440afa</code></a> chore(release): 2.8.7</li> <li><a href="https://github.com/npm/hosted-git-info/commit/2d0bb6615ecb8f9ef1019bc0737aab7f6449641f"><code>2d0bb66</code></a> fix: Do not attempt to use url.URL when unavailable</li> <li><a href="https://github.com/npm/hosted-git-info/commit/f2cdfcf33ad2bd3bd1acdba0326281089f53c5b1"><code>f2cdfcf</code></a> fix: Do not pass scp-style URLs to the WhatWG url.URL</li> <li><a href="https://github.com/npm/hosted-git-info/commit/e1b83df5d9cb1f8bb220352e20565560548d2292"><code>e1b83df</code></a> chore(release): 2.8.6</li> <li><a href="https://github.com/npm/hosted-git-info/commit/ff259a6117c62df488e927820e30bec2f7ee453f"><code>ff259a6</code></a> Ensure passwords in hosted Git URLs are correctly escaped</li> <li><a href="https://github.com/npm/hosted-git-info/commit/624fd6f301dd5a1fd7ad1b333d6f8921a12ff98c"><code>624fd6f</code></a> chore(release): 2.8.5</li> <li>Additional commits viewable in <a href="https://github.com/npm/hosted-git-info/compare/v2.8.2...v2.8.9">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~nlf">nlf</a>, a new releaser for hosted-git-info since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -6

0 comment

1 changed file

pr created time in 9 hours

PR opened bombsimon/async-await-demo

Bump hosted-git-info from 2.8.8 to 2.8.9 in /js

Bumps hosted-git-info from 2.8.8 to 2.8.9. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md">hosted-git-info's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9">2.8.9</a> (2021-04-07)</h2> <h3>Bug Fixes</h3> <ul> <li>backport regex fix from <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/76">#76</a> (<a href="https://github.com/npm/hosted-git-info/commit/29adfe5">29adfe5</a>), closes <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/84">#84</a></li> </ul> <p><!-- raw HTML omitted --><!-- raw HTML omitted --></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/npm/hosted-git-info/commit/8d4b3697d79bcd89cdb36d1db165e3696c783a01"><code>8d4b369</code></a> chore(release): 2.8.9</li> <li><a href="https://github.com/npm/hosted-git-info/commit/29adfe5ef789784c861b2cdeb15051ec2ba651a7"><code>29adfe5</code></a> fix: backport regex fix from <a href="https://github-redirect.dependabot.com/npm/hosted-git-info/issues/76">#76</a></li> <li>See full diff in <a href="https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~nlf">nlf</a>, a new releaser for hosted-git-info since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

pr created time in 9 hours

delete branch bombsimon/async-await-demo

delete branch : dependabot/npm_and_yarn/js/lodash-4.17.21

delete time in 9 hours

PR opened bombsimon/async-await-demo

Bump lodash from 4.17.19 to 4.17.21 in /js

Bumps lodash from 4.17.19 to 4.17.21. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/lodash/lodash/commit/f299b52f39486275a9e6483b60a410e06520c538"><code>f299b52</code></a> Bump to v4.17.21</li> <li><a href="https://github.com/lodash/lodash/commit/c4847ebe7d14540bb28a8b932a9ce1b9ecbfee1a"><code>c4847eb</code></a> Improve performance of <code>toNumber</code>, <code>trim</code> and <code>trimEnd</code> on large input strings</li> <li><a href="https://github.com/lodash/lodash/commit/3469357cff396a26c363f8c1b5a91dde28ba4b1c"><code>3469357</code></a> Prevent command injection through <code>_.template</code>'s <code>variable</code> option</li> <li><a href="https://github.com/lodash/lodash/commit/ded9bc66583ed0b4e3b7dc906206d40757b4a90a"><code>ded9bc6</code></a> Bump to v4.17.20.</li> <li><a href="https://github.com/lodash/lodash/commit/63150ef7645ac07961b63a86490f419f356429aa"><code>63150ef</code></a> Documentation fixes.</li> <li><a href="https://github.com/lodash/lodash/commit/00f0f62a979d2f5fa0287c06eae70cf9a62d8794"><code>00f0f62</code></a> test.js: Remove trailing comma.</li> <li><a href="https://github.com/lodash/lodash/commit/846e434c7a5b5692c55ebf5715ed677b70a32389"><code>846e434</code></a> Temporarily use a custom fork of <code>lodash-cli</code>.</li> <li><a href="https://github.com/lodash/lodash/commit/5d046f39cbd27f573914768e3b36eeefcc4f1229"><code>5d046f3</code></a> Re-enable Travis tests on <code>4.17</code> branch.</li> <li><a href="https://github.com/lodash/lodash/commit/aa816b36d402a1ad9385142ce7188f17dae514fd"><code>aa816b3</code></a> Remove <code>/npm-package</code>.</li> <li>See full diff in <a href="https://github.com/lodash/lodash/compare/4.17.19...4.17.21">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~bnjmnt4n">bnjmnt4n</a>, a new releaser for lodash since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

pr created time in 9 hours

fork shaneutt/logrusr

📝 A logr implementation using Logrus

fork in 10 hours

issue commentbombsimon/logrusr

BUG: log.WithName() is not threadsafe

Thank you very much for your detailed examples on how to reproduce, will try to resolve this as soon as possible!

</img>

shaneutt

comment created time in 10 hours

issue commentgolangci/golangci-lint

linter crashes with panic

It seems to be a bug with the new nilness analyzer, then I recommend disabling this analyzer.

  govet:
    enable-all: true
    disable:
      - nilness
gucio321

comment created time in 12 hours

issue commentgolangci/golangci-lint

linter crashes with panic

Hello,

The problem seems related to govet, as a workaround you can disable it. I will investigate.

gucio321

comment created time in 12 hours

issue commentgolangci/golangci-lint

linter crashes with panic

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

gucio321

comment created time in 13 hours

issue openedgolangci/golangci-lint

linter crashes with panic

<!-- Thank you for creating the issue! -->

  • [x] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • [ ] Yes, I've searched similar issues on GitHub and didn't find any.
  • [x] Yes, I've included all information below (version, config, etc).
  • [ ] Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

<!-- Please include the following information: -->

<details><summary>Description of the problem</summary>

linter crashes on OpenDiablo2 project. here is a workflow run, which reproduces this behavior

</details>

<details><summary>Version of golangci-lint</summary>

$ golangci-lint --version
golangci-lint has version 1.40.0 built from 5c6adb63 on 2021-05-10T10:45:21Z

</details>

<details><summary>Config file</summary>

$ cat .golangci.yml
---
linters-settings:
  dupl:
    threshold: 100
  funlen:
    lines: 100
    statements: 50
  goconst:
    min-len: 2
    min-occurrences: 2
  gocritic:
    enabled-tags:
      - diagnostic
      - experimental
      - opinionated
      - performance
      - style
    disabled-checks:
  gocyclo:
    min-complexity: 15
  gofmt:
    simplify: true
  goimports:
    local-prefixes: github.com/OpenDiablo2/OpenDiablo2
  golint:
    min-confidence: 0.8
  govet:
    enable-all: true
    check-shadowing: true
    disable:
      # While struct sizes could be smaller if fields aligned properly, that also leads
      # to possibly non-intuitive layout of struct fields (harder to read). Disable
      # `fieldalignment` check here until we evaluate if it is worthwhile.
      - fieldalignment
  lll:
    line-length: 140
  misspell:
    locale: US

linters:
  disable-all: true
  enable:
    - bodyclose
    - deadcode
    - depguard
    - dogsled
    - dupl
    - errcheck
    - funlen
    - gochecknoglobals
    - gochecknoinits
    - gocognit
    - goconst
    - gocritic
    - gocyclo
    - godox
    - gofmt
    - goimports
    - golint
    - gomnd
    - goprintffuncname
    - gosec
    - gosimple
    - govet
    - ineffassign
    - lll
    - misspell
    - nakedret
    - prealloc
    - rowserrcheck
    - staticcheck
    - structcheck
    - stylecheck
    - typecheck
    - unconvert
    - unparam
    - unused
    - varcheck
    - whitespace
    - wsl

run:
  timeout: 5m
  tests: true
  skip-dirs:
    - .github
    - build
    - web

issues:
  exclude-rules:
    - linters:
        - funlen
      # Disable 'funlen' linter for test functions.
      # It's common for table-driven tests to be more than 60 characters long
      source: "^func Test"
  max-issues-per-linter: 0
  max-same-issues: 0
  exclude-use-default: false

</details>

<details><summary>Go environment</summary>

$ go version && go env
go version go1.16.4 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/user/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/user/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.4"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3225948580=/tmp/go-build -gno-record-gcc-switches"

</details>

<details><summary>Verbose output of running</summary>

$ golangci-lint cache clean
$ golangci-lint run -v ./...
INFO [config_reader] Config search paths: [./ /home/mszeptuch/git/d2/me/OpenDiablo2 /home/mszeptuch/git/d2/me /home/mszeptuch/git/d2 /home/mszeptuch/git /home/mszeptuch /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 38 linters: [bodyclose deadcode depguard dogsled dupl errcheck funlen gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godox gofmt goimports golint gomnd goprintffuncname gosec gosimple govet ineffassign lll misspell nakedret prealloc rowserrcheck staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck whitespace wsl] 
INFO [loader] Go packages loading at mode 575 (exports_file|files|imports|name|compiled_files|deps|types_sizes) took 454.737027ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 163.235443ms 
INFO [linters context/goanalysis] analyzers took 1m25.799685893s with top 10 stages: the_only_name: 4.987980064s, buildir: 4.764309399s, buildssa: 4.169827884s, gocritic: 4.089240111s, dupl: 3.977163207s, gosec: 3.601953723s, directives: 2.657086921s, whitespace: 2.580385854s, gocyclo: 2.355753677s, goimports: 2.350630905s 
WARN [linters context] Panic: bodyclose: package "d2app" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA: goroutine 10588 [running]:
runtime/debug.Stack(0x11f2447, 0x3c, 0xc0030fe9c8)
	runtime/debug/stack.go:24 +0x9f
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1(0xc001a938c0)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:101 +0x1be
panic(0x1000a00, 0xc00b7c7920)
	runtime/panic.go:965 +0x1b9
github.com/timakin/bodyclose/passes/bodyclose.runner.run(0xc00a7b5d40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc00a7b5d40, 0x0, ...)
	github.com/timakin/bodyclose@v0.0.0-20200424151742-cb6215831a94/passes/bodyclose/bodyclose.go:45 +0x837
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc001a938c0)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:187 +0x9f2
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x2a
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc002e55770, 0x1159d21, 0x9, 0xc0046bef70)
	github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x4d
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc001a938c0)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:104 +0x91
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc009cf8df0, 0xc001a938c0)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0x65
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x316 
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: bodyclose: package "d2app" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA 
INFO [runner] processing took 3.476µs with stages: max_same_issues: 675ns, skip_dirs: 425ns, nolint: 317ns, cgo: 278ns, max_from_linter: 242ns, autogenerated_exclude: 212ns, uniq_by_line: 162ns, identifier_marker: 161ns, filename_unadjuster: 151ns, path_prettifier: 133ns, diff: 118ns, skip_files: 116ns, exclude: 68ns, path_shortener: 65ns, max_per_file_from_linter: 62ns, source_code: 62ns, severity-rules: 59ns, sort_results: 59ns, exclude-rules: 56ns, path_prefixer: 55ns 
INFO [runner] linters took 3.753465733s with stages: goanalysis_metalinter: 3.753419759s 
INFO File cache stats: 188 entries of total size 919.5KiB 
INFO Memory: 44 samples, avg is 237.9MB, max is 344.7MB 
INFO Execution took 4.378323222s   

</details>

<details><summary>Code example or link to a public repository</summary>

https://github.com/OpenDiablo2/OpenDiablo2 </details>

created time in 13 hours

startedAiwizo/react-file-dropzone

started time in 13 hours

issue openedbombsimon/logrusr

BUG: log.WithName() is not threadsafe

There's a thread safety issue with this logger we found during test runs when we first implemented it, wherein it appears the WithName() functionality triggers a data race.

The following program can be used to review and reproduce the issue:

module test

go 1.16

require (
	github.com/bombsimon/logrusr v1.0.0
	github.com/sirupsen/logrus v1.8.1
)
package main

import (
	"sync"

	"github.com/bombsimon/logrusr"
	"github.com/sirupsen/logrus"
)

var logr = logrus.New()
var log = logrusr.NewLogger(logr)

func main() {
}

func asyncLog() {
	wg := sync.WaitGroup{}

	wg.Add(1)
	go func() {
		log := logr.WithField("name", "test1")
		log.Info("test1")
		wg.Done()
	}()

	wg.Add(1)
	go func() {
		log := logr.WithField("name", "test2")
		log.Info("test2")
		wg.Done()
	}()

	wg.Wait()

	return
}

func asyncLogRace() {
	wg := sync.WaitGroup{}

	wg.Add(1)
	go func() {
		log = log.WithName("test1")
		log.Info("test1")
		wg.Done()
	}()

	wg.Add(1)
	go func() {
		log = log.WithName("test2")
		log.Info("test2")
		wg.Done()
	}()

	wg.Wait()

	return
}

With these tests:

package main

import "testing"

func TestLoggerSucceeds(t *testing.T) {
	asyncLog()
}

func TestLoggerFails(t *testing.T) {
	asyncLogRace()
}

Using similar functionality with sirupsen/logrus the tests succeed:

$ go test -v -race -run 'TestLoggerSucceeds'
=== RUN   TestLoggerSucceed
INFO[0000] test2                                         name=test2
INFO[0000] test1                                         name=test1
--- PASS: TestLoggerSucceed (0.00s)
PASS
ok  	test	0.021s

However with similar functionality this logger fails due to a found race condition:

$ go test -v -race -run 'TestLoggerFails'
=== RUN   TestLoggerFails
==================
WARNING: DATA RACE
Read at 0x00c00002a040 by goroutine 9:
  github.com/bombsimon/logrusr.(*logrusr).WithName()
      /home/shane/.local/go/pkg/mod/github.com/bombsimon/logrusr@v1.0.0/logrusr.go:90 +0x57
  test.asyncLogRace.func2()
      /tmp/tmp.ZgM86gRKhY/test/main.go:50 +0x6b

Previous write at 0x00c00002a040 by goroutine 8:
  github.com/bombsimon/logrusr.(*logrusr).WithName()
      /home/shane/.local/go/pkg/mod/github.com/bombsimon/logrusr@v1.0.0/logrusr.go:90 +0xee
  test.asyncLogRace.func1()
      /tmp/tmp.ZgM86gRKhY/test/main.go:43 +0x6b

created time in 14 hours

issue closedgolangci/golangci-lint

a config file has high priority than command-line options `--disable-all`

<!-- Thank you for creating the issue! -->

  • [x] Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • [x] Yes, I've searched similar issues on GitHub and didn't find any.
  • [x] Yes, I've included all information below (version, config, etc).
  • [x] Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

<!-- Please include the following information: -->

<details><summary>Description of the problem</summary>

The config file has lower priority than command-line options. If the same bool/string/int option is provided on the command-line and in the config file, the option from command-line will be used. Slice options (e.g. list of enabled/disabled linters) are combined from the command-line and config file.

https://golangci-lint.run/usage/configuration/

But, --disable-all is not available as follows

# With config file
$ golangci-lint run --disable-all --fix -E gci

sample/sample.go:50:6: `get` is unused (deadcode)
func get(){}

</details>

<details><summary>Version of golangci-lint</summary>

$ golangci-lint --version
golangci-lint has version v1.40.0 built from (unknown, mod sum: "h1:MFueiIIh9Ri5yWLRu9RkrS0nd2F+x67zC7ISQR2Hta4=") on (unknown)

</details>

<details><summary>Config file</summary>

$ cat .golangci.yml
linters-settings:
  gci:
    local-prefixes: hogehogehoge # private repo
linters:
  enable:
    - govet
    - errcheck
    - staticcheck
    - unused
    - gosimple
    - structcheck
    - varcheck
    - ineffassign
    - deadcode
    - typecheck
    - gosec
    - prealloc
    - gocognit
    - gci

</details>

<details><summary>Go environment</summary>

$ go version && go env
go version go1.16 darwin/amd64
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kenseinakada/Library/Caches/go-build"
GOENV="/Users/kenseinakada/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/kenseinakada/go/1.14.4/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/kenseinakada/go/1.14.4:/Users/kenseinakada/go/1.16.0"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/kenseinakada/.goenv/versions/1.16.0"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/kenseinakada/.goenv/versions/1.16.0/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/kenseinakada/workspace/website-server/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rw/7byjyh1d73qft75rrw2m9ns80000gn/T/go-build4039158151=/tmp/go-build -gno-record-gcc-switches -fno-common"

</details>

<details><summary>Verbose output of running</summary>

$ golangci-lint cache clean
$ golangci-lint run -v
 golangci-lint run -v                       
INFO [config_reader] Config search paths: [./ /Users/kenseinakada/workspace/website-server /Users/kenseinakada/workspace /Users/kenseinakada /Users /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 14 linters: [deadcode errcheck gci gocognit gosec gosimple govet ineffassign prealloc staticcheck structcheck typecheck unused varcheck] 
INFO [loader] Go packages loading at mode 575 (compiled_files|deps|exports_file|name|types_sizes|files|imports) took 1.293421628s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 6.338016ms 
INFO [linters context/goanalysis] analyzers took 29.60776324s with top 10 stages: buildir: 19.072165637s, fact_deprecated: 1.424373534s, inspect: 1.349569079s, ctrlflow: 1.335017154s, printf: 1.219457416s, fact_purity: 1.204501138s, nilness: 1.175531984s, typedness: 1.040805289s, SA5012: 1.015641009s, gci: 87.24066ms 
INFO [runner] Issues before processing: 2, after processing: 1 
INFO [runner] Processors filtering stat (out/in): nolint: 2/2, uniq_by_line: 1/2, diff: 1/1, max_same_issues: 1/1, source_code: 1/1, path_shortener: 1/1, severity-rules: 1/1, filename_unadjuster: 2/2, path_prettifier: 2/2, skip_files: 2/2, exclude: 2/2, exclude-rules: 2/2, cgo: 2/2, identifier_marker: 2/2, max_per_file_from_linter: 1/1, path_prefixer: 1/1, sort_results: 1/1, skip_dirs: 2/2, autogenerated_exclude: 2/2, max_from_linter: 1/1 
INFO [runner] processing took 1.943975ms with stages: identifier_marker: 468.501µs, nolint: 455.115µs, autogenerated_exclude: 338.451µs, filename_unadjuster: 292.429µs, source_code: 205.978µs, path_prettifier: 110.577µs, skip_dirs: 34.194µs, exclude-rules: 19.867µs, uniq_by_line: 3.963µs, cgo: 3.725µs, max_same_issues: 3.421µs, path_shortener: 3.101µs, max_from_linter: 1.38µs, max_per_file_from_linter: 762ns, sort_results: 584ns, diff: 549ns, skip_files: 469ns, exclude: 410ns, severity-rules: 341ns, path_prefixer: 158ns 
INFO [runner] linters took 7.204543617s with stages: goanalysis_metalinter: 7.201490168s 
database/migration.go:50:6: `get` is unused (deadcode)
func get(){}
     ^
INFO File cache stats: 1 entries of total size 1.6KiB 
INFO Memory: 86 samples, avg is 510.7MB, max is 810.9MB 
INFO Execution took 8.57519375s                   

The following expects that only gci will be executed


$ golangci-lint run -v --disable-all --fix -E gci
INFO [config_reader] Config search paths: [./ /Users/kenseinakada/workspace/website-server /Users/kenseinakada/workspace /Users/kenseinakada /Users /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 14 linters: [deadcode errcheck gci gocognit gosec gosimple govet ineffassign prealloc staticcheck structcheck typecheck unused varcheck] 
INFO [loader] Go packages loading at mode 575 (deps|imports|name|types_sizes|compiled_files|exports_file|files) took 1.329004717s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 3.546664ms 
INFO [linters context/goanalysis] analyzers took 0s with no stages 
INFO [runner] Issues before processing: 2, after processing: 1 
INFO [runner] Processors filtering stat (out/in): severity-rules: 1/1, cgo: 2/2, max_same_issues: 1/1, max_from_linter: 1/1, path_prettifier: 2/2, skip_dirs: 2/2, sort_results: 1/1, exclude: 2/2, nolint: 2/2, source_code: 1/1, filename_unadjuster: 2/2, skip_files: 2/2, identifier_marker: 2/2, diff: 1/1, max_per_file_from_linter: 1/1, path_shortener: 1/1, path_prefixer: 1/1, autogenerated_exclude: 2/2, exclude-rules: 2/2, uniq_by_line: 1/2 
INFO [runner] processing took 916.904µs with stages: nolint: 321.54µs, source_code: 245.116µs, autogenerated_exclude: 169.157µs, path_prettifier: 82.059µs, identifier_marker: 34.541µs, skip_dirs: 31.607µs, exclude-rules: 13.256µs, uniq_by_line: 7.289µs, filename_unadjuster: 2.527µs, max_same_issues: 2.435µs, path_shortener: 1.636µs, cgo: 1.554µs, max_from_linter: 1.056µs, max_per_file_from_linter: 778ns, skip_files: 509ns, diff: 490ns, sort_results: 484ns, severity-rules: 355ns, exclude: 335ns, path_prefixer: 180ns 
INFO [runner] linters took 238.8876ms with stages: goanalysis_metalinter: 237.801844ms 
INFO fixer took 0s with no stages                 
database/migration.go:50:6: `get` is unused (deadcode)
func get(){}
     ^
INFO File cache stats: 1 entries of total size 1.6KiB 
INFO Memory: 17 samples, avg is 71.9MB, max is 72.1MB 
INFO Execution took 1.586652491s           

</details>

<details><summary>Code example or link to a public repository</summary>

// go file with dead code

func get(){}

</details>

closed time in 14 hours

sanposhiho

issue commentgolangci/golangci-lint

a config file has high priority than command-line options `--disable-all`

Aha, OK I understood what you mean.

Looking at the document I mistakenly thought the flow would be as follows

  1. Enable some linter with config file
  2. --disable-all disable all linter (include linter of step 1)

Thanks :D

sanposhiho

comment created time in 14 hours

startedbombsimon/logrusr

started time in 14 hours