Skip to content

Commit

Permalink
Update go modules (#22)
Browse files Browse the repository at this point in the history
* Update go modules

Signed-off-by: Stavros Foteinopoulos <[email protected]>

* lint fixes and removal of deprecated lambda

Signed-off-by: Stavros Foteinopoulos <[email protected]>

* more lint fixes

Signed-off-by: Stavros Foteinopoulos <[email protected]>

---------

Signed-off-by: Stavros Foteinopoulos <[email protected]>
  • Loading branch information
stafot authored Nov 9, 2023
1 parent 4b45249 commit daa7f27
Show file tree
Hide file tree
Showing 78 changed files with 1,600 additions and 2,378 deletions.
16 changes: 16 additions & 0 deletions account-alerts/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

run:
skip-dirs-use-default: false

linters:
enable:
- revive
- gocyclo
- misspell

gocyclo:
min-complexity: 15

issues:
exclude-use-default: false

35 changes: 34 additions & 1 deletion account-alerts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,41 @@ pack:
@echo "Packing binary..."
@zip $(PACKAGE).zip $(HANDLER)

update-modules:
go get -u ./...
go mod tidy

.PHONY: fmt
## fmt: Run go fmt on codebase
fmt:
@echo Checking if code is formatted
files=$$(go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' .); \
if [ "$$files" ]; then \
gofmt_output=$$(gofmt -d -s $$files 2>&1); \
if [ "$$gofmt_output" ]; then \
echo "$$gofmt_output"; \
echo "gofmt failed"; \
echo "To fix it, run:"; \
echo "go fmt [FILE]"; \
exit 1; \
fi; \
fi; \
echo "gofmt success"; \

.PHONY: lint
## lint: Run golangci-lint on codebase
lint:
@echo "Linting..."
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
exit 1; \
fi; \

@echo Running golangci-lint
golangci-lint run ./...

clean:
@echo "Cleaning up..."
@rm -rf $(HANDLER) $(PACKAGE).zip

.PHONY: all dep build pack clean
.PHONY: all build pack clean update-modules
47 changes: 44 additions & 3 deletions account-alerts/go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,54 @@
module github.com/mattermost/mattermost-cloud-lambdas/account-mattermost-alerts

go 1.15
go 1.21

require (
github.com/aws/aws-lambda-go v1.13.3
github.com/aws/aws-sdk-go v1.35.5
github.com/mattermost/mattermost-server/v5 v5.31.1
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
k8s.io/apimachinery v0.20.2 // indirect
k8s.io/client-go v11.0.0+incompatible
k8s.io/client-go v0.28.3
)

require (
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/dyatlov/go-opengraph v0.0.0-20180429202543-816b6608b3c8 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mattermost/go-i18n v1.11.0 // indirect
github.com/mattermost/ldap v0.0.0-20191128190019-9f62ba4b8d4d // indirect
github.com/mattermost/logr v1.0.13 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/philhofer/fwd v1.0.0 // indirect
github.com/tinylib/msgp v1.1.2 // indirect
github.com/wiggin77/cfg v1.0.2 // indirect
github.com/wiggin77/merror v1.0.2 // indirect
github.com/wiggin77/srslog v1.0.1 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
160 changes: 80 additions & 80 deletions account-alerts/go.sum

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions account-alerts/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Package main defines an AWS Lambda function that monitors the IP address utilization of subnets within AWS VPCs.
// It checks for provisioning subnets reaching IP address capacity and sends notifications if the number of
// available IP addresses falls below a defined threshold. The function is triggered to evaluate the environment
// variables for configuration, establish a new AWS session, check the IAM role's permissions, and iterate
// through subnets within VPCs to assess and report on IP address availability. Notifications for any identified
// issues are sent to a configured Mattermost channel.
package main

import (
Expand Down
16 changes: 16 additions & 0 deletions alert-elb-cloudwatch-alarm/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

run:
skip-dirs-use-default: false

linters:
enable:
- revive
- gocyclo
- misspell

gocyclo:
min-complexity: 15

issues:
exclude-use-default: false

35 changes: 34 additions & 1 deletion alert-elb-cloudwatch-alarm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,37 @@ clean:
@echo "Cleaning up..."
@rm -rf $(HANDLER) $(PACKAGE).zip

.PHONY: all dep build pack clean
update-modules:
go get -u ./...
go mod tidy

.PHONY: fmt
## fmt: Run go fmt on codebase
fmt:
@echo Checking if code is formatted
files=$$(go list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' .); \
if [ "$$files" ]; then \
gofmt_output=$$(gofmt -d -s $$files 2>&1); \
if [ "$$gofmt_output" ]; then \
echo "$$gofmt_output"; \
echo "gofmt failed"; \
echo "To fix it, run:"; \
echo "go fmt [FILE]"; \
exit 1; \
fi; \
fi; \
echo "gofmt success"; \

.PHONY: lint
## lint: Run golangci-lint on codebase
lint:
@echo "Linting..."
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
exit 1; \
fi; \

@echo Running golangci-lint
golangci-lint run ./...

.PHONY: all build pack clean update-modules
17 changes: 12 additions & 5 deletions alert-elb-cloudwatch-alarm/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
module github.com/mattermost/mattermost-cloud-monitoring/alert-elb-cloudwatch-alarm
module github.com/mattermost/mattermost-cloud-lambdas/alert-elb-cloudwatch-alarm

go 1.13
go 1.21

require (
github.com/aws/aws-lambda-go v1.14.1
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.6
github.com/sirupsen/logrus v1.4.2
github.com/aws/aws-lambda-go v1.41.0
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.22
github.com/sirupsen/logrus v1.9.3
)

require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
golang.org/x/sys v0.14.0 // indirect
)
55 changes: 28 additions & 27 deletions alert-elb-cloudwatch-alarm/go.sum
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aws/aws-lambda-go v1.14.1 h1:iklNeBEa1+EbcYVomAcZXXSEViwFzygvAPQ48TLvDlA=
github.com/aws/aws-lambda-go v1.14.1/go.mod h1:FEwgPLE6+8wcGBTe5cJN3JWurd1Ztm9zN4jsXsjzKKw=
github.com/aws/aws-lambda-go v1.15.0 h1:QAhRWvXttl8TtBsODN+NzZETkci2mdN/paJ0+1hX/so=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/aws/aws-lambda-go v1.41.0 h1:l/5fyVb6Ud9uYd411xdHZzSf2n86TakxzpvIoz7l+3Y=
github.com/aws/aws-lambda-go v1.41.0/go.mod h1:jwFe2KmMsHmffA1X2R09hH6lFzJQxzI8qK17ewzbQMM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-retryablehttp v0.5.1 h1:Vsx5XKPqPs3M6sM4U4GWyUqFS8aBiL9U5gkgvpkg4SE=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-retryablehttp v0.5.1/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.6 h1:jbPcx0GlwyDkFqFPVQQ5SXCHMVmftLo3gTLGJJM4GZg=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.0.6/go.mod h1:f0ezb0R/mrB9Hpm5RrIS6EX3ydjsR2nAB88nYYXZcNY=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.22 h1:0h+YoXSyipf6XQGyIaDg6z5jwRik1JSm+sQetnD7vGY=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.22/go.mod h1:4OjcxgwdXzezqytxN534MooNmrxRD50geWZxTD7845s=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190607181551-461777fb6f67/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6 changes: 4 additions & 2 deletions alert-elb-cloudwatch-alarm/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main handles AWS SNS messages and creates alerts based on the message contents.
package main

import (
Expand All @@ -15,6 +16,7 @@ import (
"github.com/opsgenie/opsgenie-go-sdk-v2/client"
)

// SNSMessageNotification represents the details of an SNS message related to AWS alarms.
type SNSMessageNotification struct {
AlarmName string `json:"AlarmName"`
AlarmDescription string `json:"AlarmDescription,omitempty"`
Expand Down Expand Up @@ -47,7 +49,7 @@ func main() {
lambda.Start(handler)
}

func handler(ctx context.Context, snsEvent events.SNSEvent) {
func handler(_ context.Context, snsEvent events.SNSEvent) {
for _, record := range snsEvent.Records {
snsRecord := record.SNS

Expand Down Expand Up @@ -101,7 +103,7 @@ func sendMattermostNotification(source string, messageNotification SNSMessageNot

payload := MMSlashResponse{
Username: source,
IconUrl: "https://cdn2.iconfinder.com/data/icons/amazon-aws-stencils/100/Non-Service_Specific_copy__AWS_Cloud-128.png",
IconURL: "https://cdn2.iconfinder.com/data/icons/amazon-aws-stencils/100/Non-Service_Specific_copy__AWS_Cloud-128.png",
Attachments: attachment,
}
if os.Getenv("MATTERMOST_HOOK") != "" {
Expand Down
13 changes: 8 additions & 5 deletions alert-elb-cloudwatch-alarm/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"net/http"
)

// MMField represents a single field in a Mattermost message attachment.
type MMField struct {
Title string `json:"title"`
Value string `json:"value"`
Short bool `json:"short"`
}

type StringInterface map[string]interface{}

// MMAttachment represents a Mattermost message attachment.
type MMAttachment struct {
Fallback *string `json:"fallback"`
Color string `json:"color"`
Expand All @@ -24,26 +24,29 @@ type MMAttachment struct {
Title *string `json:"title"`
TitleLink *string `json:"title_link"`
Text *string `json:"text"`
ImageUrl *string `json:"image_url"`
ImageURL *string `json:"image_url"`
Fields []*MMField `json:"fields"`
}

// MMSlashResponse represents a Mattermost slash command response.
type MMSlashResponse struct {
ResponseType string `json:"response_type,omitempty"`
Username string `json:"username,omitempty"`
IconUrl string `json:"icon_url,omitempty"`
IconURL string `json:"icon_url,omitempty"`
Channel string `json:"channel,omitempty"`
Text string `json:"text,omitempty"`
GotoLocation string `json:"goto_location,omitempty"`
Attachments []MMAttachment `json:"attachments,omitempty"`
}

// AddField adds a field to the MMAttachment.
func (attachment *MMAttachment) AddField(field MMField) *MMAttachment {
attachment.Fields = append(attachment.Fields, &field)
return attachment
}

func (o *MMSlashResponse) ToJson() string {
// ToJSON converts the MMSlashResponse to a JSON string.
func (o *MMSlashResponse) ToJSON() string {
b, _ := json.Marshal(o)
return string(b)
}
Expand Down
17 changes: 17 additions & 0 deletions bind-server-network-attachment/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

run:
skip-dirs-use-default: false

linters:
enable:
- gofmt
- revive
- gocyclo
- misspell

gocyclo:
min-complexity: 15

issues:
exclude-use-default: false

Loading

0 comments on commit daa7f27

Please sign in to comment.