title: no-op/explicitly do nothing in go
body: <p>I have a type method that mutates the type's fields. It takes no arguments and returns nothing. The bulk of the method is a <code>switch</code> block. I want to be able to "short-circuit" out of the <code>switch</code> block with a no-op. Before I refactored it into a type method, I would've just returned out of the function, but that's out. Removing the case would break the logic of the method--the <code>default</code> case mutates state, which I don't want to do if this case is matched. I need the equivalent of Python's <code>pass</code>, basically.</p>
  
  <p>Code:</p>
  
  <pre><code>func (parser *Parser) endSectionName () {
      state = parser.State
      buffer = parser.buffer
      results = parser.results
      switch {
          case state.HasFlag(IN_ESCAPED) {
              // ???
          }
          case !inSection(state) {
              return state, NotInSectionError
          }
          case !state.HasFlag(IN_SECTION_NAME) {
              state.Reset()
              return state, errors.New("Parsing error: Not in section name")
          }
          default {
              state.RemoveFlag(IN_SECTION_NAME)
              s := buffer.String()
              results[s] = new(Section)
              buffer.Reset()
              return state, nil
          }
      }
  }
  </code></pre>