Skip to content

Commit

Permalink
minor lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jptosso committed Aug 5, 2023
1 parent 59f6b81 commit 03bf29d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion experimental/plugins/auditlog_formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (testFormatter) Format(al plugintypes.AuditLog) ([]byte, error) {
return []byte(al.Transaction().ID()), nil
}

func (_ testFormatter) MIME() string {
func (testFormatter) MIME() string {
return "sample"
}

Expand Down
4 changes: 2 additions & 2 deletions internal/auditlog/formats.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

type nativeFormatter struct{}

func (_ nativeFormatter) Format(al plugintypes.AuditLog) ([]byte, error) {
func (nativeFormatter) Format(al plugintypes.AuditLog) ([]byte, error) {
boundaryPrefix := fmt.Sprintf("--%s-", utils.RandomString(10))

var res strings.Builder
Expand Down Expand Up @@ -104,7 +104,7 @@ func (_ nativeFormatter) Format(al plugintypes.AuditLog) ([]byte, error) {
return []byte(res.String()), nil
}

func (_ nativeFormatter) MIME() string {
func (nativeFormatter) MIME() string {
return "application/x-coraza-auditlog-native"
}

Expand Down
4 changes: 2 additions & 2 deletions internal/auditlog/formats_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (

type jsonFormatter struct{}

func (_ jsonFormatter) Format(al plugintypes.AuditLog) ([]byte, error) {
func (jsonFormatter) Format(al plugintypes.AuditLog) ([]byte, error) {
jsdata, err := json.Marshal(al)
if err != nil {
return nil, err
}
return jsdata, nil
}

func (_ jsonFormatter) MIME() string {
func (jsonFormatter) MIME() string {
return "application/json; charset=utf-8"
}

Expand Down
4 changes: 2 additions & 2 deletions internal/auditlog/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func TestGetUnknownWriter(t *testing.T) {

type noopFormatter struct{}

func (_ noopFormatter) Format(al plugintypes.AuditLog) ([]byte, error) { return nil, nil }
func (_ noopFormatter) MIME() string { return "" }
func (noopFormatter) Format(al plugintypes.AuditLog) ([]byte, error) { return nil, nil }
func (noopFormatter) MIME() string { return "" }

func TestGetFormatters(t *testing.T) {
t.Run("missing formatter", func(t *testing.T) {
Expand Down

0 comments on commit 03bf29d

Please sign in to comment.