Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-04-09 07:57:35 +02:00
committed by GitHub
parent ea5a0d5229
commit 64cb538dbf
11 changed files with 55 additions and 567 deletions

41
.golangci.yml Normal file
View File

@@ -0,0 +1,41 @@
run:
timeout: 10m
build-tags:
- containers_image_openpgp
- exclude_graphdriver_btrfs
- exclude_graphdriver_devicemapper
linters:
enable:
- deadcode
- depguard
- gofmt
- goimports
- revive
- govet
- importas
- ineffassign
- misspell
- typecheck
- varcheck
- errname
- makezero
- whitespace
disable-all: true
linters-settings:
depguard:
list-type: blacklist
include-go-root: true
packages:
# The io/ioutil package has been deprecated.
# https://go.dev/doc/go1.16#ioutil
- io/ioutil
importas:
no-unaliased: true
issues:
exclude-rules:
- linters:
- revive
text: "stutters"

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1-labs # syntax=docker/dockerfile:1
ARG GO_VERSION="1.17" ARG GO_VERSION="1.18"
ARG GORELEASER_XX_VERSION="1.2.5" ARG GORELEASER_XX_VERSION="1.2.5"
FROM --platform=$BUILDPLATFORM crazymax/goreleaser-xx:${GORELEASER_XX_VERSION} AS goreleaser-xx FROM --platform=$BUILDPLATFORM crazymax/goreleaser-xx:${GORELEASER_XX_VERSION} AS goreleaser-xx

View File

@@ -38,7 +38,7 @@ func (s *ServeCmd) Run(ctx *Context) error {
log.Info().Str("version", version).Msgf("Starting %s", ctx.Meta.Name) log.Info().Str("version", version).Msgf("Starting %s", ctx.Meta.Name)
// Handle os signals // Handle os signals
channel := make(chan os.Signal) channel := make(chan os.Signal, 1)
signal.Notify(channel, os.Interrupt, utl.SIGTERM) signal.Notify(channel, os.Interrupt, utl.SIGTERM)
go func() { go func() {
sig := <-channel sig := <-channel

View File

@@ -1,5 +1,5 @@
variable "GO_VERSION" { variable "GO_VERSION" {
default = "1.17" default = "1.18"
} }
// GITHUB_REF is the actual ref that triggers the workflow // GITHUB_REF is the actual ref that triggers the workflow

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/crazy-max/diun/v4 module github.com/crazy-max/diun/v4
go 1.17 go 1.18
require ( require (
github.com/AlecAivazis/survey/v2 v2.3.4 github.com/AlecAivazis/survey/v2 v2.3.4

553
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1-labs # syntax=docker/dockerfile:1
ARG GO_VERSION="1.17" ARG GO_VERSION="1.18"
ARG PROTOC_VERSION="3.17.3" ARG PROTOC_VERSION="3.17.3"
ARG GLIBC_VERSION="2.33-r0" ARG GLIBC_VERSION="2.33-r0"

View File

@@ -1,9 +1,10 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
ARG GO_VERSION="1.17" ARG GO_VERSION="1.18"
ARG GOLANGCI_LINT_VERSION="v1.37" ARG GOLANGCI_LINT_VERSION="v1.45"
FROM golang:${GO_VERSION}-alpine AS base FROM golang:${GO_VERSION}-alpine AS base
ENV GOFLAGS="-buildvcs=false"
RUN apk add --no-cache gcc linux-headers musl-dev RUN apk add --no-cache gcc linux-headers musl-dev
WORKDIR /src WORKDIR /src
@@ -12,4 +13,4 @@ FROM base AS lint
RUN --mount=type=bind,target=. \ RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/root/.cache \
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \ --mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
golangci-lint run --timeout 10m0s ./... golangci-lint run ./...

View File

@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1-labs # syntax=docker/dockerfile:1
ARG GO_VERSION="1.17" ARG GO_VERSION="1.18"
ARG GOMOD_OUTDATED_VERSION="v0.8.0" ARG GOMOD_OUTDATED_VERSION="v0.8.0"
FROM golang:${GO_VERSION}-alpine AS base FROM golang:${GO_VERSION}-alpine AS base

View File

@@ -41,7 +41,7 @@ type Sections struct {
Facts []Fact `json:"facts"` Facts []Fact `json:"facts"`
} }
// Fact is grouping data togheter to create a nested json element containg a name and an associated value // Fact is grouping data together to create a nested json element containing a name and an associated value
type Fact struct { type Fact struct {
Name string `json:"Name"` Name string `json:"Name"`
Value string `json:"Value"` Value string `json:"Value"`

View File

@@ -31,7 +31,6 @@ func (c *Client) listFileImage() []model.Image {
continue continue
} }
for _, item := range items { for _, item := range items {
// Check NotifyOn // Check NotifyOn
if len(item.NotifyOn) == 0 { if len(item.NotifyOn) == 0 {
item.NotifyOn = model.NotifyOnDefaults item.NotifyOn = model.NotifyOnDefaults