Skip to content

Commit

Permalink
Remove code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
harture committed Apr 16, 2019
1 parent 74a43b9 commit 139991f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions pkg/event/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func addCTtypeToEvent(event map[string]string) map[string]string {
return event
}
default:

// Nothing to do here
}

switch t := event["kc_event_type"]; t {
Expand Down Expand Up @@ -183,7 +183,7 @@ func addCTtypeToEvent(event map[string]string) map[string]string {
event["ct_event_type"] = "LOGOUT"
return event
default:

// Nothing to do here
}

// for all those events that don't have set the ct_event_type, we assign an empty ct_event_type
Expand Down Expand Up @@ -227,8 +227,8 @@ func adminEventToMap(adminEvent *fb.AdminEvent) map[string]string {
adminEventMap["ct_event_type"] = "ADMIN"

// BE AWARE: error is not treated
infoJson, _ := json.Marshal(addInfo)
adminEventMap["additional_info"] = string(infoJson)
infoJSON, _ := json.Marshal(addInfo)
adminEventMap["additional_info"] = string(infoJSON)

//set the correct ct_event_type for actions like create_account, etc.
adminEventMap = addCTtypeToEvent(adminEventMap)
Expand Down Expand Up @@ -278,8 +278,8 @@ func eventToMap(event *fb.Event) map[string]string {
}

// BE AWARE: error is not treated
infoJson, _ := json.Marshal(addInfo)
eventMap["additional_info"] = string(infoJson)
infoJSON, _ := json.Marshal(addInfo)
eventMap["additional_info"] = string(infoJSON)

if !doNotSetCTEventType {
eventMap = addCTtypeToEvent(eventMap)
Expand Down
4 changes: 2 additions & 2 deletions pkg/event/component_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func TestEventToMapNewCTEvent(t *testing.T) {
}

func TestEventToMapLogon(t *testing.T) {
var etype int8 = 0
var etype int8

var event *fb.Event
{
Expand Down Expand Up @@ -477,7 +477,7 @@ func TestAdminEventToMap(t *testing.T) {

func TestAdminEventToMapAccountCreated(t *testing.T) {
var resourcePath = "users/8caefab3-90d1-492e-87e0-1bf6cecc76ea/role-mappings/realm "
var optype int8 = 0
var optype int8

var adminEvent *fb.AdminEvent
{
Expand Down

0 comments on commit 139991f

Please sign in to comment.