for simplicity, rather than having multiple duplicated Dockerfile, merge both dockerfile into 1, and use docker build stage to separate test image & production image
for e. g:
FROM golang AS builder
FROM golang AS test
# copy test binary from builder
FROM golang AS tomato
# copy production binary from builder