You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: room.go
    path of file: ./repos/pan-light/server/realtime
    
    the code of the file until where you have to start completion: package realtime

import "sync"

type sessionIdSlice []SessionId

func (slice sessionIdSlice) index(id SessionId) int {
	for idx, idInSlice := range slice {
		if idInSlice == id {
			retur
    
func (r *Room) Join(id SessionId) {
	r.lock.Lock()
	defer r.lock.Unlock()
	if r.members.index(id) > -1 {
		return
	}
	r.members = append(r.members, id)

	ss, _ := r.server.SessionById(id)
	ss.lock.Lock()
	ss.rooms = append(ss.rooms, r)
	ss.lock.Unlock()
	go r.Broadcast("room.member.join", id)
}