profile
viewpoint
Simon Sawert bombsimon @EmbarkStudios Stockholm, Sweden https://sawert.se

0x4b53/amqp-rpc 8

Framework to use RabbitMQ as RPC

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

💿 Source code for the web site

0x4b53/epp-go 3

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 commentbombsimon/wsl

Label at the end of a block is not a whitespace (nor comment)

@Oppodelldog yep, you’re right. This should not be a part of wsl so it should be fixed, that’s why I left the issue open. This lintet should not warn about this! PRs welcome! :)

olibre

comment created time in 17 hours

pull request commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

Thank you so much for your time and sorry for the mess! Let me know if you want me to squash this now or if you'll do that when merging (or whatever merge strategy you prefer).

bombsimon

comment created time in 2 days

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha c66573ed2a8b5e4a68de88f1bcf1b9cbde96a7a4

Update CHANGELOG

view details

push time in 2 days

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0  ## Unreleased +Fix: macOS can run `buildkite_agent_count` job-runners now.

Heh, I just pushed before reading this! Let's use this one!

bombsimon

comment created time in 2 days

PullRequestReviewEvent

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha 73f1efc573d2c2b4c1669cc20e4e54daa14dfb8b

Update CHANGELOG

view details

push time in 2 days

pull request commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

Looking good, thank you for your patience and fast turnaround :)

And thank you for the same! This ended up totally different than I thought but I guess this is way better. All we had to do was to let the Buildkite agent configuration handle this since the service is just the bootstrapping.

Thanks for the proposed feedback, I'm learning about the Buildkite agents this way!

bombsimon

comment created time in 2 days

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha a5645b5fc2aa5c488859a1aa936d4f44db7e6757

Just set spawn in Buildkite config, drop plist management

view details

push time in 2 days

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0  ## Unreleased +## 3.2.1: 2020-11-18++Add support to configure number of agents to spawn with launchd on macOS by setting the --spwan flag.

Yep, my bad. This is basically all that the PR needed for this to work:

diff --git a/templates/buildkite-agent.cfg.j2 b/templates/buildkite-agent.cfg.j2
index e18622b..239e986 100644
--- a/templates/buildkite-agent.cfg.j2
+++ b/templates/buildkite-agent.cfg.j2
@@ -4,6 +4,9 @@ token="{{ buildkite_agent_token }}"
 # The name of the agent
 name="%hostname-%n"

+# Number of agents to spawn
+spawn="{{ buildkite_agent_count | default('1') }}"
+

Now I feel stupid, but I guess this is better. Will push these changes, if you still want to manage a plist file let me know!

bombsimon

comment created time in 2 days

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0  ## Unreleased +## 3.2.1: 2020-11-18++Add support to configure number of agents to spawn with launchd on macOS by setting the --spwan flag.

Nono, you're right, I'm the one not fully understanding here. To be honest I'm pretty new with both Ansible and Buildkite so it's a bit of cargo cult programming. I appreciate your help and feedback suggestions! The config buildkite_agent_count exists but isn't used. Setting it's value to the variable BUILDKITE_AGENT_SPAWN which will then be used by Buildkite to configure --spawn seems like a good idea.

Or actually, reading the docs, this could be set just by adding spawn to the Buildkite configuration. And by doing so we woudn't even have to manage the plist file at all. Let me try that!

bombsimon

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">++<!-- https://launchd.info -->++<plist version="1.0">+<dict>+  <key>EnvironmentVariables</key>+  <dict>+    <key>PATH</key>

Ahh, my bad! Didn't read the docs through enough, this will set the --spawn flag for us and no need for the --spawn={{ buildkite_agent_spawn }} which I see you removed.

bombsimon

comment created time in 2 days

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

     state: latest     update_homebrew: yes +- name: Configure Buildkite service+  template:+    src: "homebrew.mxcl.buildkite-agent.plist.j2"+    dest: "{{ buildkite_agent_conf_dir[ansible_os_family] }}/homebrew.mxcl.buildkite-agent.plist"

When passing a plist to launchd with brew services (re)?start service <plist>, the plist is automatically copied to ~/Library/LaunchAgents by brew.

bombsimon

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

     state: restarted   when: ansible_os_family == "Windows" and buildkite_agent_allow_service_startup[ansible_os_family] -- name: Restart Buildkite Agent and Register for Login-  command: /usr/local/bin/brew services restart buildkite/buildkite/buildkite-agent-  when: ansible_os_family == "Darwin" and buildkite_agent_allow_service_startup[ansible_os_family]--- name: Start Buildkite Agent and Register for Login-  command: /usr/local/bin/brew services start buildkite/buildkite/buildkite-agent+- name: restart-darwin-buildkite+  command: /usr/local/bin/brew services restart buildkite/buildkite/buildkite-agent {{ buildkite_agent_conf_dir[ansible_os_family] }}/homebrew.mxcl.buildkite-agent.plist

Tbh I don't know actually. It's a common pattern and the name is copied from when brew creates the file manually if not specified by the user.

bombsimon

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0  ## Unreleased +## 3.2.1: 2020-11-18++Add support to configure number of agents to spawn with launchd on macOS by setting the --spwan flag.

Not sure if this is correct with my current solution though. buildkite_agent_count is still not used but instead the new variable introduced in this PR for buildkite_agent_spawn. Like #42 states buildkite_agent_count isn't used (on any OS) so maybe just remove that parameter?

bombsimon

comment created time in 2 days

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha 050bcba7574b7adf25a20bf06d21c691e0877755

Update CHANGELOG and README

view details

push time in 2 days

pull request commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

Not sure if this is sufficient but here's a screenshot (I guess it could've been just logs) and the logs I piped in the screenshot to not clutter the screen too much. At least it shows my simple setup required to reproduce this.

Also note that the first iteration is with my current state which is with spawn configured.

Screenshot 2020-09-18 at 14 48 54 log1.log log2.log

bombsimon

comment created time in 2 days

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha 50a08e569470c8fb89723a4784771c8c8fa5f7d7

Use better when condition for configuring service Always configure the service as long as we're on Darwin and buildkite_agent_allow_service_startup is set to true. The template will omit the spawn configuration if it's not defined, otherwise --spawn will be set to the value of buildkite_agent_spawn

view details

push time in 2 days

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha a4ff178a774d73150f94473bd783b1a81685bbfc

Address PR feedback * Add when condition to spawn flag * Set buildkite-agent user's home directory as working directory * Add launchd link to plist * Sort keys in plist file * Add user, group and comment to plist file permission * Add buildkite_agent_spawn, defaulting to BUILDKITE_AGENT_SPAWN

view details

push time in 2 days

Pull request review commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

+<?xml version="1.0" encoding="UTF-8"?>+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">+<plist version="1.0">+<dict>+  <key>Label</key>+  <string>homebrew.mxcl.buildkite-agent</string>++  <key>WorkingDirectory</key>+  <string>/usr/local/bin</string>++  <key>ProgramArguments</key>+  <array>+    <string>{{ buildkite_agent_executable[ansible_os_family] }}</string>+    <string>start</string>+    <string>--config</string>+    <string>{{ buildkite_agent_conf_dir[ansible_os_family] }}/buildkite-agent.cfg</string>+    <string>--spawn={{ buildkite_agent_count }}</string>

I don't see any other reference to environment variables so I'm not sure what you mean here? Do you want me to introduce a new configuration parameter and default to this environment variable instead of using buildkite_agent_count?

Just using the environment variable as is would require the user to specify it each time they run the playbook instead of being able to configure a var, seems more cumbersome to me.

This also realtes a bit to the CR about when.

I think this would be nice: buildkite_agent_spawn: lookup('env', 'BUILDKITE_AGENT_SPAWN') + when: buildkite_agent_spawn is defined.

WDYT?

bombsimon

comment created time in 2 days

PullRequestReviewEvent

pull request commentimprobable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

Thank you very much for the quick response! Will address all your feedback and provide some logs and screenshots!

bombsimon

comment created time in 2 days

PR opened improbable-eng/ansible-buildkite-agent

Add support for buildkite_agent_count on macOS

Changes

  • Add plist to use for multiple agents according to docs
  • Configure plist and pass to brew service with buildkite_agent_count parameter
  • Renamed handlers to match Linux and Windows
  • Removed never used handler Start Buildkite Agent and Register for Login
  • Update default executable path based on brew location

Verification

Running locally, confirming multiple agents is spawned in Buildkite UI

+60 -9

0 comment

4 changed files

pr created time in 2 days

push eventbombsimon/ansible-buildkite-agent

Simon Sawert

commit sha 17542f84fbc1e5c784253606336bb122c1e2cce5

Add support for buildkite_agent_count on macOS

view details

push time in 2 days

create barnchbombsimon/ansible-buildkite-agent

branch : agent-count-darwin

created branch time in 2 days

fork bombsimon/ansible-buildkite-agent

An Ansible role to install the Buildkite Agent.

fork in 2 days

issue openedimprobable-eng/ansible-buildkite-agent

buildkite_agent_count is not used

Thank you very much for this nice and easy to use role. I noticed that the documentation mentions buildkite_agent_count as a configurable to have multiple services running with a link to the documentation. Sadly this parameter has no effect in the current role.

Would be nice to have this working!

Versions of relevant software used

macOS 10.15.6 Ansible 2.9.11

What happened

I set buildkite_agent_count to 2 in the configuration.

What you expected to happen

Two services to be started and launchd to be configured.

How to reproduce it (as minimally and precisely as possible):

You example folder would do!

Full logs to relevant components

-

Anything else we need to know

Environment:

  • OS (e.g. from /etc/os-release): macOS 10.15.6
  • Kernel (e.g. uname -a): Darwin Kernel Version 19.6.0
  • Others: -

created time in 2 days

startedbaowenbo/DAIN

started time in 3 days

issue commentimprobable-eng/ansible-buildkite-agent

Homebrew 2.3.0 has broken this ansible role

I just installed a machine with macOS Catalina 10.15.6 and latest Homebrew 2.5.1 today and I could not reproduce this issue.

filipVisko

comment created time in 3 days

startedu-root/gobusybox

started time in 3 days

issue commentbombsimon/wsl

Consider `i++` as an assignment used in the iteration

Thanks for taking the time to do new benchmarks. I guess this tells us that it's fine to use append if it's faster 6/9 times?

Also, the times we're talking about is extremely low, a diff of ~100 ns/op (if even that). This would only have any actual effect on very large numbers and big lists. For a list of 1000 items the added time would be 0.1 ms.

olibre

comment created time in 7 days

push eventgolangci/golangci-lint

dependabot[bot]

commit sha 857f744ac4da440f2516d92d73ec2de0f706edab

build(deps): bump node-fetch in /.github/contributors (#1363) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 7 days

PR merged golangci/golangci-lint

build(deps): bump node-fetch from 2.6.0 to 2.6.1 in /.github/contributors dependencies javascript

Bumps node-fetch from 2.6.0 to 2.6.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/bitinn/node-fetch/releases">node-fetch's releases</a>.</em></p> <blockquote> <h2>v2.6.1</h2> <p><strong>This is an important security release. It is strongly recommended to update as soon as possible.</strong></p> <p>See <a href="https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md#v261">CHANGELOG</a> for details.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md">node-fetch's changelog</a>.</em></p> <blockquote> <h2>v2.6.1</h2> <p><strong>This is an important security release. It is strongly recommended to update as soon as possible.</strong></p> <ul> <li>Fix: honor the <code>size</code> option after following a redirect.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/node-fetch/node-fetch/commit/b5e2e41b2b50bf2997720d6125accaf0dd68c0ab"><code>b5e2e41</code></a> update version number</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/2358a6c2563d1730a0cdaccc197c611949f6a334"><code>2358a6c</code></a> Honor the <code>size</code> option after following a redirect and revert data uri support</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/8c197f8982a238b3c345c64b17bfa92e16b4f7c4"><code>8c197f8</code></a> docs: Fix typos and grammatical errors in README.md (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/686">#686</a>)</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/1e99050f944ac435fce26a9549eadcc2419a968a"><code>1e99050</code></a> fix: Change error message thrown with redirect mode set to error (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/653">#653</a>)</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/244e6f63d42025465796e3ca4ce813bf2c31fc5b"><code>244e6f6</code></a> docs: Show backers in README</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/6a5d192034a0f438551dffb6d2d8df2c00921d16"><code>6a5d192</code></a> fix: Properly parse meta tag when parameters are reversed (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/682">#682</a>)</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/47a24a03eb49a49d81b768892aee10074ed54a91"><code>47a24a0</code></a> chore: Add opencollective badge</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/7b136627c537cb24430b0310638c9177a85acee1"><code>7b13662</code></a> chore: Add funding link</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/5535c2ed478d418969ecfd60c16453462de2a53f"><code>5535c2e</code></a> fix: Check for global.fetch before binding it (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/674">#674</a>)</li> <li><a href="https://github.com/node-fetch/node-fetch/commit/1d5778ad0d910dbd1584fb407a186f5a0bc1ea22"><code>1d5778a</code></a> docs: Add Discord badge</li> <li>Additional commits viewable in <a href="https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1">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/~akepinski">akepinski</a>, a new releaser for node-fetch 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) You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

dependabot[bot]

pr closed time in 7 days

PullRequestReviewEvent

issue closedbombsimon/wsl

Consecutive `var` declarations can be cuddled

Simplified version of my code:

for result.Next() {
    // some
    // code

    var a string
    var b interface{} // declarations should never be cuddled (wsl)

    for key, val := range result.Values() {
        [...]

I have found two options to respect the rule declarations should never be cuddled in that case.

  1. Add a blank line between the two var statements:

    for result.Next() {
        // some
        // code
    
        var a string
    
        var b interface{}
    
        for key, val := range result.Values() {
            [...]
    
  2. Group together the var statements:

    for result.Next() {
        // some
        // code
    
        var (
            a string
            b interface{}
        )
    
        for key, val := range result.Values() {
            [...]
    

But, in my opinion, the original code seems readable. I suggest that consecutive var declarations can be cuddled. @bombsimon What is your feeling?

closed time in 8 days

olibre

issue commentbombsimon/wsl

Consecutive `var` declarations can be cuddled

My bad, #83 was to cuddle var declarations and assignments. Cuddling var declarations with var declarations has always been supported. It uses the --allow-cuddle-declarations flag in wsl and is configureable with allow-cuddle-declarations in the .golangci.yml configuration file.

olibre

comment created time in 8 days

issue commentbombsimon/wsl

Label at the end of a block is not a whitespace (nor comment)

I don't know why you would do this in golang though, it seems lika a pattern from BASIC och batch scripting. Maybe that says more about me but I thought I've seen my shared amount of Go code and this pattern never occurred to me. In your example I would just use break to exit the loop. If I wanted to break out of nested loops I would label the outer most loop and break that one like so:

OUTER:
    for range a {
        for _, x := range b {
            if x == y {
                break OUTER
            }
        }
    }

If I had code that wasn't related to this loop that I wanted to skip i would use return. If I had code after this loop that I wanted to scope and more code after that that I wanted to execute I would break this function into several functions since that sounds like it's doing way to much.

I tried to Google and see when a good use case for goto in golang would be and I found some references to stdlib. Those however is never to go to the end of a scope and especially not to the end of a function.

So basically this is not intended but since I want this linter to enforce good practices not only by adding whitespaces but to think of what's a good way to tackle an issue and improve readability I don't see this as something that I do want to support. Ending a scope with a label just to be able to goto it is not something I want to encourage.

Obviously this is my personal opinion so feel free to argue why you think this is a good pattern and what the benefits over the other control flows such as break, countinue and return this would have.

olibre

comment created time in 8 days

issue commentbombsimon/wsl

Consecutive `var` declarations can be cuddled

This is actually already implemented in #83 (originally discussed in #82) and merged in #87. #83 is still open but with the tag golangci-lint-only whicih means the feature is implemented but not merged upstream to golangci-lint.

I guess I could try to merge it into upstream and close the issue, there are actually two more issues with this tag.

olibre

comment created time in 8 days

issue closedgolangci/golangci-lint

Failing in GitHub Actions when project contains private repositories in go.mod

Thank you for creating the issue!

  • [ + ] 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.
  • [ + ] Yes, I've included all information below (version, config, etc).

Please include the following information:

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

# ...
    runs-on: "ubuntu-18.04"
# ...
      - name: "[lint|set-up] golang dependencies"
        id: "lint-golang"
        run: |
          wget https://github.com/golangci/golangci-lint/releases/download/v1.31.0/golangci-lint-1.31.0-linux-amd64.deb
          sudo dpkg -i golangci-lint-1.31.0-linux-amd64.deb
          git config --global url."https://${USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
      - name: "[lint] non destructive check"
        id: "ci-lint"
        run: |
          golangci-lint run --verbose
        env:
          GOPRIVATE: "github.com/<edited>/*"
# ...

</details>

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

N/A

</details>

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

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/runner/.cache/go-build"
GOENV="/home/runner/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="github.com/<edited>/*"
GONOSUMDB="github.com/<edited>/*"
GOOS="linux"
GOPATH="/home/runner/go"
GOPRIVATE="github.com/<edited>/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/hostedtoolcache/go/1.13.15/x64"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/hostedtoolcache/go/1.13.15/x64/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/runner/work/<edited>/<edited>/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build380172567=/tmp/go-build -gno-record-gcc-switches"

</details>

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

golangci-lint run --verbose;
go: github.com/<edited> invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/runner/go/pkg/mod/cache/vcs/<edited>: exit status 128:
	remote: Repository not found.
	fatal: repository 'https://github.com/<edited>' not found
level=info msg="[config_reader] Config search paths: [./ /home/runner/work/<edited>/<edited> /home/runner/work/<edited> /home/runner/work /home/runner /home /]"
level=info msg="[lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck]"
level=info msg="[loader] Go packages loading at mode 575 (name|exports_file|deps|files|imports|types_sizes|compiled_files) took 448.16677ms"
level=error msg="Running error: context loading failed: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: go: github.com/<edited>: invalid version: git fetch -f https://github.com/<edited> refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/runner/go/pkg/mod/cache/vcs/<edited>: exit status 128:\n\tremote: Repository not found.\n\tfatal: repository 'https://github.com/<edited>/' not found\n"
level=info msg="Memory: 6 samples, avg is 70.8MB, max is 70.8MB"
level=info msg="Execution took 454.295361ms"GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build380172567=/tmp/go-build -gno-record-gcc-switches"

</details>

closed time in 8 days

Hellseher

issue commentgolangci/golangci-lint

Failing in GitHub Actions when project contains private repositories in go.mod

Please give this issue a read: How to use private go modules dependencies?

Also closing this since it's a question about the action and not the linter. Please open an issue in golangci-lint-action for GitHub Action related questions or problems.

Hellseher

comment created time in 8 days

issue commentbombsimon/wsl

Consider `i++` as an assignment used in the iteration

Thanks for the issue! Similar questions have been adressed in f.ex. #81. I think I've never considered this since I think it's a bad pattern to use that kind of indexing. There are two linked posts about benchmarking assigning indexes vs appending if you set both a length and capacity of your slice. Basically, I would suggest just writing this:

func sortedKeys(m map[string]interface{}) sort.StringSlice {
	keys := make(sort.StringSlice, 0, len(m))
	for k := range m {
		keys = append(keys, k)
	}

	sort.Sort(keys)

	return keys
}

It's not exactly a response to your question though since it's not the same code. If I didn't have any alternative but to use i I personally think the most readable way would be to group assignments and then separate them from the loop.

func sortedKeys(m map[string]interface{}) sort.StringSlice {
	keys := make(sort.StringSlice, len(m))
	i := 0

	for k := range m {
		keys[i] = k
		i++
	}

	sort.Sort(keys)

	return keys
}

Or personally I would've grouped them in a var block for alignment:

func sortedKeys(m map[string]interface{}) sort.StringSlice {
    var (
        keys = make(sort.StringSlice, len(m))
        i    = 0
    )

    for k := range m {
        keys[i] = k
        i++
    }

    sort.Sort(keys)

    return keys
}

If none of these alternatives feels relevant for you I think the other valid proposal would be #24 where the idea is to allow anything cuddled to any block as long as it's used in the block itself. This is a quite common patterns for channels and go routines or like in your case keeping track of a counter in a loop.

olibre

comment created time in 8 days

startedimprobable-eng/ansible-buildkite-agent

started time in 9 days

startedKiakra/Kiragine

started time in 10 days

pull request commentgolangci/golangci-lint

Add stringintconv and ifaceassert to govet

@bombsimon Something wrong here, it had to fail here: https://github.com/golangci/golangci-lint/pull/1360/files#diff-fec92a1aa6b31bf39c48b7934581c028R13

converted to draft

Oh, I was too quick. Will do a new review when converted to PR again!

SVilgelm

comment created time in 12 days

PullRequestReviewEvent
PullRequestReviewEvent

startedjoncampbell123/dosbox-x

started time in 12 days

issue commentbombsimon/hltv-python

Connect to scorebot without socket().wait()

@Funeoz I did a quick switch to the AsyncClient from socektio, please see example for usage and how to run the socket stream in the background.

I didn't make any other methods async but I don't think they benefit much from being so. Please let me know if you run in to any trouble!

Funeoz

comment created time in 13 days

push eventbombsimon/hltv-python

Simon Sawert

commit sha d954e86afd80c91800ec8c50a4165a29ca14adb3

Use AsyncClient from socketio

view details

push time in 13 days

push eventbombsimon/async-await-demo

Simon Sawert

commit sha 99818f73c1e7c55e97de7293535fa5d9bc7a2bbb

Add python example

view details

push time in 13 days

startedstascorp/rdpwrap

started time in 13 days

push eventgolangci/golangci-lint-action

dependabot[bot]

commit sha 9d250b4a7c3ca6d3a30d5d751bd545549a64c3d8

build(deps-dev): bump @types/node from 14.6.2 to 14.6.4 (#85) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.6.2 to 14.6.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

push time in 13 days

PR merged golangci/golangci-lint-action

build(deps-dev): bump @types/node from 14.6.2 to 14.6.4 dependencies javascript

Bumps @types/node from 14.6.2 to 14.6.4. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare view</a></li> </ul> </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)

</details>

+4 -4

0 comment

2 changed files

dependabot[bot]

pr closed time in 13 days

PullRequestReviewEvent

issue commentibmdb/go_ibm_db

SIGFPE on one of two computers (macOS)

@akhilravuri1 Feel free to close this issue. macOS 10.13 High Sierra will be discontinued 30th November 2020 so it's just a few months away. Thank you for your help looking into this!

bombsimon

comment created time in 13 days

issue commentibmdb/go_ibm_db

SIGFPE on one of two computers (macOS)

@akhilravuri1 Thanks for keeping this open!

Sadly I don't have access to a computer with macOS 10.13 anymore. @tobiassjosten are you still on 10.13? Can you give this a try?

If not I think we should close this issue.

bombsimon

comment created time in 13 days

issue commentgolangci/golangci-lint-action

How to use private go modules dependencies?

Personally I don't think thats something up to golangci-lint to document since it is true for all actions requiring access to other private repositories.

steebchen

comment created time in 16 days

issue commentstreadway/amqp

Request Updating library (go.mod) to v1.14

Yeah, you are right! Since Go only supports the latest two versions it might be a good idea to be somewhere nearer that.

I can't close any issue since I'm not an owner or member of the project. Feel free to leave it open or close it yourself, I was just looking through the issues to see if I cold help out. :)

houseofcat

comment created time in 16 days

startedagnipau/slap

started time in 17 days

push eventbombsimon/enum

Simon Sawert

commit sha 73e9db22b6f33894dc02011b578930bc79f326dc

Add timestamp for generated files

view details

push time in 17 days

PR merged bombsimon/enum

Add timestamp for generated files
+21 -10

0 comment

5 changed files

bombsimon

pr closed time in 17 days

PR opened bombsimon/enum

Add timestamp for generated files
+21 -10

0 comment

5 changed files

pr created time in 17 days

delete branch bombsimon/enum

delete branch : enum-fix

delete time in 18 days

delete branch bombsimon/enum

delete branch : string-constants

delete time in 18 days

push eventbombsimon/hook-test

Simon Sawert

commit sha bd1d92731b58bd410ae738d07e6d48d5d022ca20

A fix

view details

push time in 18 days

push eventbombsimon/hook-test

Simon Sawert

commit sha 52656ee1529788ea93f5ecdb80580b587aa14270

A fix

view details

push time in 18 days

startedbottlerocket-os/bottlerocket

started time in 18 days

issue commentstreadway/amqp

Request Updating library (go.mod) to v1.14

Changing the version in go.mod for this package only says that it cannot be imported in projects with an older version. If you run v.1.14 in your project you are able to use this package without any problems.

What do you want to accomplish by bumping the version of this package's go.mod?

houseofcat

comment created time in 19 days

issue commentstreadway/amqp

same channel hadler in many go routiens

Yes.

rakeshrvce

comment created time in 19 days

issue commentstreadway/amqp

Policy option

According to this SO post policies cannot be set over the AMQP protocol and is thus not a part of this project. How to set policies via the RESTful API is described in the RabbtMQ documentation. This should be possible with net/http.

BentCoder

comment created time in 19 days

issue commentstreadway/amqp

concurrent publish occur: "Exception (504) Reason: "channel/connection is not open"

Even though declaring exchanges, queues and binding them should be idempotent I think you're setting yourself up for trouble by performing these commands in 100 go routines at the same time. It could happen just so that you send multiple declarations of the same exchange f.ex. at the same time which I think could lead to issues on the server side.

I tried your code as is and it works most of the time but sometimes I see the same errors as you do. When I got errors it was resolved by just restarting the RabbitMQ server.

However, by moving the declaration of the exchange, the queue and binding them to InitMQ() I can no longer reproduce this issue (newly started or already running RabbitMQ server)

<details> <summary>MRE</summary>

docker run --rm -it -p 5672:5672 rabbitmq:3

package main

import (
	"fmt"
	"sync"

	"github.com/streadway/amqp"
)

func InitMQ() *amqp.Channel {
	conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/")
	if err != nil {
		panic(err)
	}

	ch, err := conn.Channel()
	if err != nil {
		panic(err)
	}

	err = ch.ExchangeDeclare("exchange1", "fanout", true, false, false, false, nil)
	if err != nil {
		panic(err)
	}

	q, err := ch.QueueDeclare("queue", true, false, false, false, nil)
	if err != nil {
		panic(err)
	}

	err = ch.QueueBind(q.Name, "", "exchange1", false, nil)
	if err != nil {
		panic(err)
	}

	return ch
}

func main() {
	ch := InitMQ()

	wg := sync.WaitGroup{}

	for i := 1; i <= 100; i++ {
		fmt.Printf("spawning go routine %d/%d\n", i, 100)
		wg.Add(1)

		go func(i int) {
			err := PublishNews(ch, []byte{byte(i)})
			if err != nil {
				fmt.Println(err)
			}

			wg.Done()
		}(i)
	}

	wg.Wait()
}

func PublishNews(ch *amqp.Channel, data []byte) (err error) {
	return ch.Publish(
		"exchange1", "", false, false,
		amqp.Publishing{
			ContentType:  "text/plain",
			Body:         data,
			DeliveryMode: 2, // durable
		})
}

</details>

wxj95

comment created time in 19 days

issue commentstreadway/amqp

Unit tests

There are no test packages or test helpers nor any interfaces bundled in this repository. Back in 2019 #387 was opened which was aiming to implement interfaces for all public methods but it never got merged. Depending on your needs you could use that as an inspiration.

If you have trouble using wabbit but still want to use it you should ask for help in that repository. There are no open issues addressing connection refused so it's probably not an issue with the package since Ii think it's quote widely used.

You could create your own interfaces with the methods you use from the library and attach where needed instead of any amqp type. This is quite common and by defining your own interface you can easily generate mocks with e.g. minimock or gomock.<sup>1</sup>

A third alternative is to look into existing wrappers for this library. amqp-rpc (not only for RPC even though it's name) is a complete wrapper around this library which has methods to be used both as a receiving server or a calling client. The wrapper uses a function which is invoked before every message is sent that can be overridden for unit tests.

A fourth alternative would be to actually use a real server in your tests. Depending on what your needs are it might be the best way to do testing. You could use docker for local testing and development and rabbitmq-action for GitHub actions or rabbitmq service in Travis.

<sup>1</sup> Example

type Publisher interface {
    Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
}

func somethingThatWillPublish(p Publisher) {
    // ...
    p.Publish("", "", false, false, someMessage)
    // ...
}

In production

conn, _ := amqp.Dial("amqp://guest:guest@localhost:5672/")
ch, _ := conn.Channel()

somethingThatWillPublish(ch)

In your unittests

type mockPublisherNoError struct {}

func (_ *mockPublisherNoError) Publish(_, _ string, _, _ bool, _ amqp.Publishing) error {
    return nil
}

mp := &mockPublisherNoError{}
somethingThatWillPublish(mp)
ErshovYS

comment created time in 19 days

push eventbombsimon/bombsimon

Simon Sawert

commit sha 2d497da3c92907fdc45ea461bf4077d7c4026068

Update README.md

view details

push time in 19 days

push eventbombsimon/hook-test

Simon Sawert

commit sha ffae593f1d735390df4dc94fb7727ac978b0f1fe

A fix

view details

push time in 19 days

push eventbombsimon/hook-test

Simon Sawert

commit sha c895c2350c2d68704d73d64ed605b27f18b3c07f

A fix

view details

push time in 19 days

PR opened bombsimon/hook-test

A fix
+4 -0

0 comment

1 changed file

pr created time in 19 days

create barnchbombsimon/hook-test

branch : xxx

created branch time in 19 days

created tagpersonnummer/perl

tagv3.0.1

🔢 Validate Swedish personal identity numbers

created time in 19 days

release personnummer/perl

v3.0.1

released time in 19 days

push eventpersonnummer/perl

Simon Sawert

commit sha 851aa7f3100dbc785741f0a8f00653173f37aa4a

Bump version

view details

push time in 19 days

delete branch personnummer/perl

delete branch : bad-serial-fix

delete time in 19 days

push eventpersonnummer/perl

Simon Sawert

commit sha 29232365584137fdab8307a61e7002f91bdd2fb0

Ensure serial is not 000

view details

push time in 19 days

PR merged personnummer/perl

Reviewers
Ensure serial is not 000
+5 -4

0 comment

2 changed files

bombsimon

pr closed time in 19 days

PR opened personnummer/perl

Ensure serial is not 000
+5 -4

0 comment

2 changed files

pr created time in 19 days

create barnchpersonnummer/perl

branch : bad-serial-fix

created branch time in 19 days

issue closedgolangci/golangci-lint

consider add mgechev/revive as new linter

https://github.com/mgechev/revive

closed time in 19 days

jasonkylelol

issue commentgolangci/golangci-lint

consider add mgechev/revive as new linter

Duplicate of #238

jasonkylelol

comment created time in 19 days

issue commentgoogleapis/google-cloud-go

spannertest: Support for GetDatabase()

Thanks for the super quick help and response!

bombsimon

comment created time in 19 days

issue commentbombsimon/wsl

Rewrite source input

Hi, thanks for the issue!

This is one of those tings that's keeping me up at night. It was definitely the plan to add a fixer for this project and a lot of people have asked for it. I created #4 myself back when the repo was new and in February i opened #72. A few things made me stop the progress

  • It's scary and dangerous to change other peoples code - I want it to be 100%
  • It's hard to consider comments when doing this kind of things - I got stuck regarding removing whitespaces for this sake. I didn't want to release a fixer that does half the job (just adds the newlines). Since whitespace and also gufumpt I think can remove leading and trailing whitespaces I started considering removing that part from my code which is some of the worst code.
  • I wanted to rewrite the parser of the code while doing this to make future maintenance easier which added a too big scope to the task
  • I just have less time than I thought to put in to this.

I would love to actually finish this up, by myself or with help from contributors, but knowing this PR is more than 6 months old I'm thinking just as much of removing this from golangci-lint as actually fixing it.

So TL;DR: I would love to provide a 100% working fixer for all the reported errors and the PR took me quite far having support to add newlines where warned. I just never finished it.

nexterot

comment created time in 19 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentbombsimon/hltv-python

Connect to scorebot without socket().wait()

The current solution uses the blocking sio implementation. There is a non blocking implementation with an AsyncClient. I don't have too much time to spend on this project but I could try to find some time to look into an implementation.

Please feel free to create a PR with an async implementation, the API looks identical except it's non blocking with the AsyncClient.

Funeoz

comment created time in 21 days

PullRequestReviewEvent

startedgleam-lang/gleam

started time in 23 days

Pull request review comment0x4b53/amqp-rpc

HandlerFunc ctx is .Done() when server is stopped

 func (s *Server) consume(binding HandlerBinding, inputCh *amqp.Channel, wg *sync 	return consumerTag, nil } -func (s *Server) runHandler(handler HandlerFunc, deliveries <-chan amqp.Delivery, queueName string, wg *sync.WaitGroup) {+func (s *Server) runHandler(

I have no strong opinions about this so go ahead! Just not used to it, but it's very clear and in a separate commit so I'm totally fine with this!

akarl

comment created time in 23 days

PullRequestReviewEvent
more