This is how I would do it. Note that you must be careful not to insert newlines. If you do, terminal control becomes trickier.
package main
import "fmt"
// ClearLine is the CSI sequence to clear the entire of the current line.
const ClearLine = "\033[2K"
func main() {
// print a string that is comparatively long
fmt.Printf("hello world")
// clear line
fmt.Printf(ClearLine)
// the line is cleared but the cursor is in the wrong place. the carriage
// return moves the cursor to the beginning of the line.
fmt.Printf("\r")
// print a shorter string to show that the longer string has been cleared
fmt.Printf("bye")
// print a newline to move the cursor to next line of terminal
fmt.Printf("\n")