code: func (c *CredentialsStore) Load(r io.Reader) error {
  	dec := json.NewDecoder(r)
  	// Read open bracket
  	_, err := dec.Token()
  	if err != nil {
  		return err
  	}
  
  	var cred Credential
  	for dec.More() {
  		err := dec.Decode(&cred)
  		if err != nil {
  			return err
  		}
  		c.store[cred.Username] = cred.Password
  		c.perms[cred.Username] = make(map[string]bool, len(cred.Perms))
  		for _, p := range cred.Perms {
  			c.perms[cred.Username][p] = true
  		}
  	}
  
  	// Read closing bracket.
  	_, err = dec.Token()
  	if err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // Load loads credential information from a reader.