title: Turn off echoing in terminal - Golang
body: <p>I'm trying to Turn off echoing in the terminal, in the Golang,</p>
  <p>Code:</p>
  <pre><code>func main() {
      
      STDINFILE := os.Stdin
      STDINFILENO := 0
  
      raw, err := unix.IoctlGetTermios(STDINFILENO, unix.TCGETA)
      if err != nil {
          panic(err)
      }
      rawState := *raw
  
      rawState.Lflag &amp;^= unix.ECHO
  
      err = unix.IoctlSetTermios(STDINFILENO, unix.TCSAFLUSH, &amp;rawState)
  
      if err != nil {
          panic(err)
      }
  
      var charValue byte
      reader := bufio.NewReader(STDINFILE)
      
      for {
          var err error
          // read one byte
          charValue, err = reader.ReadByte()
          if err != nil {
              if err == io.EOF {
                  fmt.Println(&quot;END OF FILE&quot;)
              }
          }
          // press q to quit.
          if charValue == 'q' {
              os.Exit(0)
          }
  
      }
  }
  </code></pre>
  <p>But it's not working as expected</p>
  <p>I'm still able to see the echoed value,</p>
  <p><a href="https://i.stack.imgur.com/d44wu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d44wu.jpg" alt="enter image description here" /></a></p>
  <p>What I'm doing wrong, Can someone please point out to me or guide me?</p>