Go中的清除缓冲区

I'm new to Golang and while I'm trying to get consecutive input, The first scanf() gets the input and the remaining scanf() are omitted

Eg:

 fmt.Println("Enter A: ")
  fmt.Scanf("%d",a)
  fmt.Println("Enter B: )
  fmt.Scanf("%d",b)

In this, the first Scanf works while the second one doesn't get any input

I think you made a typo:

fmt.Println("Enter B: ) 

fmt.Println("Enter B: ")

Notice the difference?

Use scan instead of scanf since you are trying to take int,

    var a, b int    
    fmt.Println("Enter A: ")
    fmt.Scan(&a)
    fmt.Println("Enter B: ")
    fmt.Scan(&b)

If you want a string input,

    reader := bufio.NewReader(os.Stdin)
    var a,b string
    fmt.Println("Enter A: ")
    a, _ := reader.ReadString("
")
    fmt.Println("Enter B: ")
    b, _ := reader.ReadString("
")