Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Go
on:
push:
branches: [ main ]
tags:
- v*
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
check-latest: true

- name: Test
run: go test -v ./...

- name: Build
run: go build -v .

- name: Run goreleaser in release mode
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v7
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 0 additions & 39 deletions .github/workflows/go.yml

This file was deleted.

7 changes: 1 addition & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- v*
branches:
- master
- main
pull_request:

jobs:
Expand All @@ -18,8 +18,3 @@ jobs:
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2

- name: Go mod tidy
run: |
go mod tidy
git diff --exit-code go.sum
29 changes: 0 additions & 29 deletions .github/workflows/goreleaser.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.*.sw[opa]
*~
coverage.html
coverage.out
/build/
/dist/
check_by_*
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ linters:
default: all
enable:
- wsl_v5
- gomodguard_v2
disable:
- wsl
- gomodguard
- cyclop
- depguard
- err113
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/NETWAYS/check_by_powershell

go 1.25.0
go 1.26

require (
github.com/NETWAYS/go-check v0.6.4
github.com/NETWAYS/go-check v1.0.0
github.com/masterzen/winrm v0.0.0-20260407182533-5570be7f80cf
github.com/spf13/pflag v1.0.10
golang.org/x/crypto v0.53.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/Azure/go-ntlmssp v0.1.1 h1:l+FM/EEMb0U9QZE7mKNEDw5Mu3mFiaa2GKOoTSsNDP
github.com/Azure/go-ntlmssp v0.1.1/go.mod h1:NYqdhxd/8aAct/s4qSYZEerdPuH1liG2/X9DiVTbhpk=
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 h1:w0E0fgc1YafGEh5cROhlROMWXiNoZqApk2PDN0M1+Ns=
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4=
github.com/NETWAYS/go-check v0.6.4 h1:4WETSVNZNEP0Yudcp5xlvxq6RGn920cmUKq4fz/P1GQ=
github.com/NETWAYS/go-check v0.6.4/go.mod h1:8/GWnq8SirreAixgRmcp82JG16NnEl38rHq9phICy9s=
github.com/NETWAYS/go-check v1.0.0 h1:YkzTwFfGR+Z+mK3Wsqpnu8wibzsB30im19iPNfCOsMQ=
github.com/NETWAYS/go-check v1.0.0/go.mod h1:8/GWnq8SirreAixgRmcp82JG16NnEl38rHq9phICy9s=
github.com/bodgit/ntlmssp v0.0.0-20240506230425-31973bb52d9b h1:baFN6AnR0SeC194X2D292IUZcHDs4JjStpqtE70fjXE=
github.com/bodgit/ntlmssp v0.0.0-20240506230425-31973bb52d9b/go.mod h1:Ram6ngyPDmP+0t6+4T2rymv0w0BS9N8Ch5vvUJccw5o=
github.com/bodgit/windows v1.0.1 h1:tF7K6KOluPYygXa3Z2594zxlkbKPAOvqr97etrGNIz4=
Expand Down
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/NETWAYS/go-check"
)

// nolint: gochecknoglobals
var (
// These get filled at build time with the proper vaules.
version = "development"
Expand Down Expand Up @@ -63,12 +62,12 @@ func main() {

err := config.Validate()
if err != nil {
check.ExitRaw(check.Unknown, "could not validate parameters: "+err.Error())
check.Exit(check.Unknown, "could not validate parameters:", err.Error())
}

rc, output, err := config.Run(time.Duration(plugin.Timeout) * time.Second)
if err != nil {
check.ExitRaw(check.Unknown, "execution failed: "+err.Error())
check.Exit(check.Unknown, "execution failed:", err.Error())
}

fmt.Print(output)
Expand Down