Skip to content

Commit

Permalink
fix: gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
DownerCase committed Dec 16, 2024
1 parent c244e4b commit 3c65eb6
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 18 deletions.
7 changes: 3 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ linters:
- exportloopref # Deprecated
- execinquery # Deprecated
- gci
- gocritic
- gofumpt
- forbidigo
- gocritic
- godot
- godox
- gomnd
- gochecknoglobals
- gosec
- ireturn
- exhaustruct
- mnd
Expand All @@ -25,12 +26,10 @@ linters:
- wsl
- err113
- stylecheck
- gochecknoglobals
- depguard
- cyclop
- whitespace
- revive
- gosec
- protogetter
- funlen
- unparam
Expand Down
1 change: 0 additions & 1 deletion cmd/monitor/page_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func (m *model_services) navDown() {
detailed.Id = id
detailed.Refresh()
m.subpage = subpage_services_detailed

}
}

Expand Down
7 changes: 4 additions & 3 deletions cmd/monitor/page_topics_detailed.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type model_topic_detailed struct {
}

func NewDetailedModel() *model_topic_detailed {

cols := []table.Column{
{Title: "", Width: 14},
{Title: "", Width: 67},
Expand Down Expand Up @@ -61,12 +60,14 @@ func (m *model_topic_detailed) updateDetailedTable(msg tea.Msg) {
rows := []table.Row{
{"Datatype", fmt.Sprintf("(%s) %s", t.Datatype.Encoding, t.Datatype.Name)},
{"Unit", t.Unit_name},
{"Messages",
{
"Messages",
fmt.Sprintf("%v (%v dropped)", t.Data_clock, t.Message_drops),
},
{"Frequency", strconv.FormatFloat(float64(t.Data_freq)/1000, 'f', -1, 32)},
{"Message Size", strconv.FormatInt(int64(t.Topic_size), 10)},
{"Connections",
{
"Connections",
fmt.Sprintf("%v local, %v external", t.Connections_local, t.Connections_external),
},
{"Tick", strconv.FormatInt(int64(t.Registration_clock), 10)},
Expand Down
1 change: 1 addition & 0 deletions ecal/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ecal

//#include <stdint.h>
import "C"

import (
"runtime/cgo"
)
Expand Down
2 changes: 2 additions & 0 deletions ecal/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package ecal
// #include "core.h"
// #include <stdlib.h>
import "C"

import (
"runtime/cgo"
"unsafe"
Expand Down Expand Up @@ -86,6 +87,7 @@ func SetUnitName(unit_name string) bool {
defer C.free(unsafe.Pointer(unit_c))
return bool(C.SetUnitName(unit_c))
}

func Ok() bool {
return bool(C.Ok())
}
Expand Down
1 change: 0 additions & 1 deletion ecal/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func TestGetVersion(t *testing.T) {
}

func TestInitializeFinalize(t *testing.T) {

if IsInitialized() {
t.Error("eCAL pre-initialized...")
}
Expand Down
1 change: 1 addition & 0 deletions ecal/logging/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logging
//#include "logging.h"
//#include "types.h"
import "C"

import (
"runtime/cgo"
"unsafe"
Expand Down
1 change: 1 addition & 0 deletions ecal/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package logging
// Log(level, _GoStringPtr(msg), _GoStringLen(msg));
// }
import "C"

import (
"fmt"
"runtime/cgo"
Expand Down
1 change: 1 addition & 0 deletions ecal/monitoring/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package monitoring

//#include "monitoring.h"
import "C"

import (
"runtime/cgo"
"unsafe"
Expand Down
1 change: 1 addition & 0 deletions ecal/monitoring/monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package monitoring
//#include "monitoring.h"
//#cgo CPPFLAGS: -I${SRCDIR}/../types
import "C"

import (
"runtime/cgo"
"strconv"
Expand Down
3 changes: 2 additions & 1 deletion ecal/protobuf/publisher/protobuf_publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ func TestProtobufPublisher(t *testing.T) {
t.Error("Message channel nil")
}

person := &protos.Person{Id: 0, Name: "John", Email: "[email protected]",
person := &protos.Person{
Id: 0, Name: "John", Email: "[email protected]",
Dog: &protos.Dog{Name: "Pluto"},
House: &protos.House{Rooms: 5},
}
Expand Down
4 changes: 2 additions & 2 deletions ecal/protobuf/subscriber/protobuf_subscriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func TestSubscriber(t *testing.T) {
go sendMessages(pub)
for range 10 {
msg, err := sub.Receive(2 * time.Second)

if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -66,7 +65,8 @@ func TestSubscriberTimeout(t *testing.T) {
}

func sendMessages(p *publisher.Publisher[*protos.Person]) {
person := &protos.Person{Id: 0, Name: "John", Email: "[email protected]",
person := &protos.Person{
Id: 0, Name: "John", Email: "[email protected]",
Dog: &protos.Dog{Name: "Pluto"},
House: &protos.House{Rooms: 5},
}
Expand Down
1 change: 1 addition & 0 deletions ecal/publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package publisher
// const char* const descriptor, size_t descriptor_len
//);
import "C"

import (
"errors"
"runtime/cgo"
Expand Down
1 change: 0 additions & 1 deletion ecal/publisher/publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ func TestPublisher(t *testing.T) {
if pub.Messages == nil {
t.Error("Message channel nil")
}

}
7 changes: 5 additions & 2 deletions ecal/registration/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package registration
//#include "types.h"
// #cgo CPPFLAGS: -I${SRCDIR}/../types
import "C"

import (
"runtime/cgo"

Expand All @@ -20,8 +21,10 @@ const (

type QualityFlags uint8

type EntityId = types.EntityId
type TopicId = types.TopicId
type (
EntityId = types.EntityId
TopicId = types.TopicId
)

type CallbackToken struct {
ecal_token uint
Expand Down
1 change: 1 addition & 0 deletions ecal/subscriber/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package subscriber
// const char* const descriptor, size_t descriptor_len
// );
import "C"

import (
"errors"
"runtime/cgo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

func NewProtobufPublisher[U any, T publisher.Msg[U]](t *testing.T, topic string) *publisher.Publisher[T] {
pub, err := publisher.New[U, T]()

if err != nil {
t.Error(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

func NewStringPublisher(t *testing.T, topic string) *publisher.Publisher {
pub, err := publisher.New()

if err != nil {
t.Error(err)
}
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func main() {
}
defer pub.Delete() // Don't forget to delete the publisher when done!

person := &protos.Person{Id: 0, Name: "John", Email: "[email protected]",
person := &protos.Person{
Id: 0, Name: "John", Email: "[email protected]",
Dog: &protos.Dog{Name: "Pluto"},
House: &protos.House{Rooms: 5},
}
Expand Down

0 comments on commit 3c65eb6

Please sign in to comment.