format by linter
This commit is contained in:
parent
99d62fcb47
commit
1e84ad95d6
|
@ -21,7 +21,7 @@ func tempPercent(value, max int) int {
|
|||
|
||||
// Function to calculate a partial radius, depending on a percentage value
|
||||
func tempProcessRadius(value, max, radius int) float64 {
|
||||
return (1 - float64(value) / float64(max)) * float64(radius) * 2 * 3.14
|
||||
return (1 - float64(value)/float64(max)) * float64(radius) * 2 * 3.14
|
||||
}
|
||||
|
||||
// Function to get the SVG, that shows the availability with a traffic light food labeling system for a given good
|
||||
|
|
|
@ -22,7 +22,7 @@ func Read(r *http.Request, to interface{}) (err error) {
|
|||
func Write(w http.ResponseWriter, data interface{}) {
|
||||
js, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
http.Error(w, "failed to encode response: " + err.Error(), http.StatusInternalServerError)
|
||||
http.Error(w, "failed to encode response: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
|
|
@ -14,7 +14,7 @@ func TestWorker(t *testing.T) {
|
|||
|
||||
runtime := 0
|
||||
|
||||
w := NewWorker(time.Duration(5) * time.Millisecond, func() {
|
||||
w := NewWorker(time.Duration(5)*time.Millisecond, func() {
|
||||
runtime = runtime + 1
|
||||
})
|
||||
go w.Start()
|
||||
|
|
|
@ -28,8 +28,8 @@ func (d *Duration) UnmarshalTOML(dataInterface interface{}) error {
|
|||
return fmt.Errorf("invalid duration: \"%s\"", data)
|
||||
}
|
||||
|
||||
unit := data[len(data) - 1]
|
||||
value, err := strconv.Atoi(string(data[:len(data) - 1]))
|
||||
unit := data[len(data)-1]
|
||||
value, err := strconv.Atoi(string(data[:len(data)-1]))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to parse duration %s: %s", data, err)
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
// Function to test UnmarshalTOML()
|
||||
func TestDuration(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
blub
|
||||
invalid structur of a config file
|
||||
(should not be able unmarshal to the config struct )
|
||||
|
|
|
@ -6,8 +6,9 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/genofire/hs_master-kss-monolith/lib/log"
|
||||
"sync"
|
||||
|
||||
"github.com/genofire/hs_master-kss-monolith/lib/log"
|
||||
)
|
||||
|
||||
// URL to the microservice, which manages permissions
|
||||
|
|
|
@ -6,8 +6,9 @@ import (
|
|||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/genofire/hs_master-kss-monolith/lib/log"
|
||||
"sync"
|
||||
|
||||
"github.com/genofire/hs_master-kss-monolith/lib/log"
|
||||
)
|
||||
|
||||
// URL to the microservice which manages the products (product catalogue)
|
||||
|
|
Reference in New Issue