Skip to content

Commit

Permalink
Update folder structure (#40)
Browse files Browse the repository at this point in the history
* Refactored folder structure, updated go.mod
* Update GitHub Actions for new folder structure

Signed-off-by: Malte Muench <[email protected]>
  • Loading branch information
mxmxchere authored Apr 15, 2024
1 parent 071f6c4 commit 00a8203
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 46 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.19
go-version: ^1.22

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
run: go get -v -t -d
working-directory: ./src

- name: Build
run: go build -v .
run: go build -v
working-directory: ./src

- name: Test
run: go test -v .
run: go test -v
working-directory: ./src
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.19
goversion: 1.22
binary_name: can2mqtt
compress_assets: false
project_path: can2mqtt
project_path: src
env:
CGO_ENABLED: 0
File renamed without changes.
15 changes: 0 additions & 15 deletions go.mod

This file was deleted.

18 changes: 0 additions & 18 deletions go.sum

This file was deleted.

2 changes: 1 addition & 1 deletion can2mqtt/main.go → src/can2mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main

import (
"fmt" // print
C2M "github.com/c3re/can2mqtt"
C2M "github.com/c3re/can2mqtt/internal"
"os" // args
)

Expand Down
15 changes: 15 additions & 0 deletions src/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/c3re/can2mqtt

go 1.22.2

require (
github.com/brutella/can v0.0.2
github.com/eclipse/paho.mqtt.golang v1.4.3
)

require (
github.com/gorilla/websocket v1.5.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
)
13 changes: 13 additions & 0 deletions src/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
github.com/brutella/can v0.0.2 h1:8TyjZrBZSwQwSr5x3U9KtKzGW8HNE/NpUgsNcYDAVIM=
github.com/brutella/can v0.0.2/go.mod h1:NYDxbQito3w4+4DcjWs/fpQ3xyaFdpXw/KYqtZFU98k=
github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik=
github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2 changes: 1 addition & 1 deletion canbushandling.go → src/internal/canbushandling.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package can2mqtt contains some tools for bridging a CAN-Interface
// and a mqtt-network
package can2mqtt
package internal

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion convertfunctions.go → src/internal/convertfunctions.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package can2mqtt
package internal

import (
"encoding/binary"
Expand Down
2 changes: 1 addition & 1 deletion main.go → src/internal/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package can2mqtt
package internal

import (
"bufio" // Reader
Expand Down
2 changes: 1 addition & 1 deletion mqtthandling.go → src/internal/mqtthandling.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package can2mqtt
package internal

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion receivehandling.go → src/internal/receivehandling.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package can2mqtt
package internal

import (
"fmt"
Expand Down

0 comments on commit 00a8203

Please sign in to comment.