Language: Go
Label: safe
CWE: CWE-1230 \u2014 Exposure of Sensitive Information Through Metadata
The product prevents direct access to a resource containing sensitive information, but it does not sufficiently limit access to metadata that is derived from the original, sensitive information.

Code:
func Dexif(filepath string, destpath string) error {
	img, err := ioutil.ReadFile(filepath)
	if err != nil {
		return err
	}
	noExifBytes, err := exifremove.Remove(img)
	if err != nil {
		return err
	}
	err = os.WriteFile(destpath, noExifBytes, 0644)
	if err != nil {
		return err
	}
	return nil
}