title: How to represent empty byte in Go
body: <p>Want to have an empty char/byte, which has zero size/length, in Go, such as <code>byte("")</code>.</p>
  
  <pre><code>
  func main() {
      var a byte = '' // not working
      var a byte = 0  // not working
  }
  
  </code></pre>
  
  <p>A more specific example is </p>
  
  <pre><code>
  func removeOuterParentheses(S string) string {
      var stack []int
      var res []byte
      for i, b := range []byte(S) {
          if b == '(' {
              stack = append(stack, i)
          } else {
              if len(stack) == 1 {
                  res[stack[0]] = '' // set this byte to be empty
                  res[i] = '' // / set this byte to be empty
              }
              stack = stack[:len(stack)-1]
          }
      }
      return string(res)
  }
  </code></pre>
  
  <p>There is <a href="https://stackoverflow.com/questions/8534178/how-to-represent-empty-char-in-java-character-class">an equivalent question in Java</a></p>