diff --git a/cmd/grumble/client.go b/cmd/grumble/client.go index d87e4b1..1913bde 100644 --- a/cmd/grumble/client.go +++ b/cmd/grumble/client.go @@ -619,7 +619,7 @@ func (client *Client) sendChannelTree(channel *Channel) { chanstate.Position = proto.Int32(int32(channel.Position)) links := []uint32{} - for cid, _ := range channel.Links { + for cid := range channel.Links { links = append(links, uint32(cid)) } chanstate.Links = links diff --git a/cmd/grumble/freeze.go b/cmd/grumble/freeze.go index bc5c4d5..36d1242 100644 --- a/cmd/grumble/freeze.go +++ b/cmd/grumble/freeze.go @@ -199,7 +199,7 @@ func (channel *Channel) Freeze() (fc *freezer.Channel, err error) { // Add linked channels links := []uint32{} - for cid, _ := range channel.Links { + for cid := range channel.Links { links = append(links, uint32(cid)) } fc.Links = links @@ -669,7 +669,7 @@ func NewServerFromFrozen(name string) (s *Server, err error) { if len(channel.Links) > 0 { links := channel.Links channel.Links = make(map[int]*Channel) - for chanID, _ := range links { + for chanID := range links { targetChannel := s.Channels[chanID] if targetChannel != nil { s.LinkChannels(channel, targetChannel) @@ -760,7 +760,7 @@ func (server *Server) UpdateFrozenChannel(channel *Channel, state *mumbleproto.C } if len(state.LinksAdd) > 0 || len(state.LinksRemove) > 0 { links := []uint32{} - for cid, _ := range channel.Links { + for cid := range channel.Links { links = append(links, uint32(cid)) } fc.Links = links diff --git a/cmd/grumble/message.go b/cmd/grumble/message.go index 4311094..504c424 100644 --- a/cmd/grumble/message.go +++ b/cmd/grumble/message.go @@ -1131,20 +1131,20 @@ func (server *Server) handleACLMessage(client *Client, msg *Message) { // message that maps user ids to usernames. if hasgroup { toadd := map[int]bool{} - for uid, _ := range group.Add { + for uid := range group.Add { users[uid] = true toadd[uid] = true } - for uid, _ := range group.Remove { + for uid := range group.Remove { users[uid] = true delete(toadd, uid) } - for uid, _ := range toadd { + for uid := range toadd { mpgroup.Add = append(mpgroup.Add, uint32(uid)) } } if haspgroup { - for uid, _ := range pgroup.MembersInContext(&parent.ACL) { + for uid := range pgroup.MembersInContext(&parent.ACL) { users[uid] = true mpgroup.InheritedMembers = append(mpgroup.InheritedMembers, uint32(uid)) } @@ -1160,7 +1160,7 @@ func (server *Server) handleACLMessage(client *Client, msg *Message) { // Map the user ids in the user map to usernames of users. queryusers := &mumbleproto.QueryUsers{} - for uid, _ := range users { + for uid := range users { user, ok := server.Users[uint32(uid)] if !ok { client.Printf("Invalid user id in ACL") diff --git a/cmd/grumble/murmurdb.go b/cmd/grumble/murmurdb.go index 24d4f60..dee16aa 100644 --- a/cmd/grumble/murmurdb.go +++ b/cmd/grumble/murmurdb.go @@ -354,7 +354,7 @@ func populateChannelsFromDatabase(server *Server, db *sql.DB, parentID int) erro } // Add subchannels - for id, _ := range parent.children { + for id := range parent.children { err = populateChannelsFromDatabase(server, db, id) if err != nil { return err diff --git a/pkg/acl/group.go b/pkg/acl/group.go index 615e878..1ac00a7 100644 --- a/pkg/acl/group.go +++ b/pkg/acl/group.go @@ -50,7 +50,7 @@ func (group *Group) AddContains(id int) (ok bool) { // AddUsers gets the list of user ids in the Add set. func (group *Group) AddUsers() []int { users := []int{} - for uid, _ := range group.Add { + for uid := range group.Add { users = append(users, uid) } return users @@ -65,7 +65,7 @@ func (group *Group) RemoveContains(id int) (ok bool) { // RemoveUsers gets the list of user ids in the Remove set. func (group *Group) RemoveUsers() []int { users := []int{} - for uid, _ := range group.Remove { + for uid := range group.Remove { users = append(users, uid) } return users @@ -106,10 +106,10 @@ func (group *Group) MembersInContext(ctx *Context) map[int]bool { } for _, curgroup := range groups { - for uid, _ := range curgroup.Add { + for uid := range curgroup.Add { members[uid] = true } - for uid, _ := range curgroup.Remove { + for uid := range curgroup.Remove { delete(members, uid) } }