there might be some reasons :
your $PATH is pointing to a different C compiler
can be due to updating go or MinGW
do this:
check go ends (CC, CXX, AR, GOARCH, GOOS) if CC is pointing ti wrong MinGW gcc that is the problem
check MinGW64 toolchain is installed and it is on $PATH
you can force go to use specific compiler by setting CC and CXX env
check go and MinGW version compatibility
if you can build with "CGO_ENABLED=0 GOOS=windows GOARCH=amd64" envs it is probably MinGW related problem