Skip to content

Commit

Permalink
refactor: gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lekotros committed Nov 28, 2022
1 parent fa930ee commit 82e89bb
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
8 changes: 4 additions & 4 deletions fork/hmq/plugins/auth/authhttp/authhttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"go.uber.org/zap"
)

//Config device kafka config
// Config device kafka config
type Config struct {
AuthURL string `json:"auth"`
ACLURL string `json:"acl"`
Expand All @@ -31,7 +31,7 @@ var (
httpClient *http.Client
)

//Init init kafak client
// Init init kafak client
func Init() *authHTTP {
content, err := ioutil.ReadFile("./plugins/auth/authhttp/http.json")
if err != nil {
Expand All @@ -56,7 +56,7 @@ func Init() *authHTTP {
return &authHTTP{client: httpClient}
}

//CheckAuth check mqtt connect
// CheckAuth check mqtt connect
func (a *authHTTP) CheckConnect(clientID, username, password string) bool {
action := "connect"
{
Expand Down Expand Up @@ -137,7 +137,7 @@ func (a *authHTTP) CheckConnect(clientID, username, password string) bool {
// return false
// }

//CheckACL check mqtt connect
// CheckACL check mqtt connect
func (a *authHTTP) CheckACL(action, clientID, username, ip, topic string) bool {

{
Expand Down
2 changes: 1 addition & 1 deletion fork/hmq/plugins/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
log = logger.Get().Named("bridge")
)

//Elements kafka publish elements
// Elements kafka publish elements
type Elements struct {
ClientID string `json:"clientid"`
Username string `json:"username"`
Expand Down
1 change: 0 additions & 1 deletion fork/hmq/plugins/bridge/csvlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ func (c *csvLog) logFilePrune() error {

// Publish implements the bridge interface - it accepts an Element then checks to see if that element is a
// message published to the admin topic for the plugin
//
func (c *csvLog) Publish(e *Elements) error {
// A short-lived lock on c allows us to
// get the Command topic then release the lock
Expand Down
2 changes: 1 addition & 1 deletion fork/hmq/plugins/bridge/csvlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
)

//Test_topicMatch is here to double check the topic matching logic
// Test_topicMatch is here to double check the topic matching logic
func Test_topicMatch(t *testing.T) {

tests := []struct {
Expand Down
4 changes: 2 additions & 2 deletions fork/hmq/plugins/bridge/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func InitKafka() *kafka {
return c
}

//connect
// connect
func (k *kafka) connect() {
conf := sarama.NewConfig()
conf.Version = sarama.V1_1_1_0
Expand All @@ -62,7 +62,7 @@ func (k *kafka) connect() {
k.kafkaClient = kafkaClient
}

//Publish publish to kafka
// Publish publish to kafka
func (k *kafka) Publish(e *Elements) error {
config := k.kafkaConfig
key := e.ClientID
Expand Down
2 changes: 0 additions & 2 deletions fork/libxml2/xpath/xpath.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
Package xpath contains tools to handle XPath evaluation.
Because of a very quirky dependency between this package and the
Expand All @@ -18,7 +17,6 @@ yourself just to appease the compiler:
func init() {
dom.SetupXPathCallback()
}
*/
package xpath

Expand Down
21 changes: 10 additions & 11 deletions fork/libxml2/xsd/xsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
//
// This is basically all you need to do:
//
// schema, err := xsd.Parse(xsdsrc)
// if err != nil {
// panic(err)
// }
// defer schema.Free()
// if err := schema.Validate(doc); err != nil{
// for _, e := range err.(SchemaValidationErr).Error() {
// println(e.Error())
// }
// }
//
// schema, err := xsd.Parse(xsdsrc)
// if err != nil {
// panic(err)
// }
// defer schema.Free()
// if err := schema.Validate(doc); err != nil{
// for _, e := range err.(SchemaValidationErr).Error() {
// println(e.Error())
// }
// }
package xsd

import (
Expand Down

0 comments on commit 82e89bb

Please sign in to comment.