code: func delimiterIndices(s string, delimiterStart, delimiterEnd byte) ([]int, error) {
  	var level, idx int
  	idxs := make([]int, 0)
  	for i := 0; i < len(s); i++ {
  		switch s[i] {
  		case delimiterStart:
  			if level++; level == 1 {
  				idx = i
  			}
  		case delimiterEnd:
  			if level--; level == 0 {
  				idxs = append(idxs, idx, i+1)
  			} else if level < 0 {
  				return nil, fmt.Errorf(`Unbalanced braces in "%q"`, s)
  			}
  		}
  	}
  
  	if level != 0 {
  		return nil, fmt.Errorf(`Unbalanced braces in "%q"`, s)
  	}
  
  	return idxs, nil
  }
docs: // delimiterIndices returns the first level delimiter indices from a string.
  // It returns an error in case of unbalanced delimiters.