code: func unpad(data []byte, terminator byte) ([]byte, error) {
  	for i := 1; i <= 16; i++ {
  		switch data[len(data)-i] {
  		case 0:
  			continue
  		case terminator:
  			return data[:len(data)-i], nil
  		default:
  			return nil, fmt.Errorf("Expected end of padding, got %d", data[len(data)-i])
  		}
  	}
  	return nil, fmt.Errorf("Expected end of padding, got 0")
  }
docs: // unpad strips padding from a message.