Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato committed Aug 31, 2022
1 parent 6ba9aab commit 01837fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Expand Up @@ -16,7 +16,7 @@
linters:
enable:
- asciicheck
- deadcode
- unused
- depguard
- errcheck
- errorlint
Expand Down
4 changes: 2 additions & 2 deletions pkg/policy/eval.go
Expand Up @@ -51,7 +51,7 @@ func EvaluatePolicyAgainstJSON(ctx context.Context, name, policyType string, pol
}

// evaluateCue evaluates a cue policy `evaluator` against `attestation`
func evaluateCue(ctx context.Context, attestation []byte, evaluator string) error {
func evaluateCue(_ context.Context, attestation []byte, evaluator string) error {
log.Printf("Evaluating attestation: %s", string(attestation))
log.Printf("Evaluator: %s", evaluator)

Expand All @@ -72,7 +72,7 @@ func evaluateCue(ctx context.Context, attestation []byte, evaluator string) erro
}

// evaluateRego evaluates a rego policy `evaluator` against `attestation`
func evaluateRego(ctx context.Context, attestation []byte, evaluator string) error {
func evaluateRego(_ context.Context, attestation []byte, evaluator string) error {
log.Printf("Evaluating attestation: %s", string(attestation))
log.Printf("Evaluating evaluator: %s", evaluator)

Expand Down
9 changes: 8 additions & 1 deletion test/cmd/getoidctoken/main.go
Expand Up @@ -19,6 +19,7 @@ import (
"log"
"net/http"
"os"
"time"

"github.com/kelseyhightower/envconfig"
)
Expand Down Expand Up @@ -52,7 +53,13 @@ func main() {
log.Fatalf("failed to process env var: %s", err)
}
http.HandleFunc("/", tokenWriter(env.FileName))
if err := http.ListenAndServe(":8080", nil); err != nil {

srv := &http.Server{
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
}

if err := srv.ListenAndServe(); err != nil {
panic(err)
}
}

0 comments on commit 01837fe

Please sign in to comment.