Lining fixes, linter and CI fixes.
This commit is contained in:
parent
de2b64ddcc
commit
4d9888d73f
@ -19,6 +19,7 @@ lint:
|
|||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
|
- pwd
|
||||||
- golangci-lint linters
|
- golangci-lint linters
|
||||||
- golangci-lint run
|
- golangci-lint run
|
||||||
|
|
||||||
@ -27,4 +28,5 @@ test:
|
|||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
|
- pwd
|
||||||
- go test -test.v -cover ./...
|
- go test -test.v -cover ./...
|
@ -6,5 +6,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
EventNotFoundError = errors.New("event not found")
|
ErrEventNotFound = errors.New("event not found")
|
||||||
)
|
)
|
||||||
|
@ -49,7 +49,7 @@ func AddEventHandler(event *EventHandler) {
|
|||||||
func LaunchEvent(eventName string, data interface{}) (interface{}, error) {
|
func LaunchEvent(eventName string, data interface{}) (interface{}, error) {
|
||||||
handler, exists := events[eventName]
|
handler, exists := events[eventName]
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, EventNotFoundError
|
return nil, ErrEventNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
returnedData := handler.Handler(data)
|
returnedData := handler.Handler(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user