Golang No TypeDir for Untar Gzip

I'm trying to write a function that will untar a gzip compressed archive (*.tar.gz) in Golang. The archives are created using tar -czvf archive.tar.gz **/*.yaml and have a file structure similar to:

.
├── config.yaml
└── my_folder
    └── config.yaml
└── my_folder_2
    └── config.yaml

The function I wrote successfully decompresses the top level config.yaml file but fails to do any other the folders. When I was debugging the function, it seems like all headers coming through the decompression is set at TypeReg instead of the folder headers coming in as TypeDir. I've tried changing things here and there but the nested files still come out as TypeReg with a header name of my_folder(_2)/config.yaml instead of separately the folders as TypeDir and then the files nested within them.

Here is my function:

func Untar(src, dest string) error {
    err := os.MkdirAll(dest, 0755)
    if err != nil {
        return err
    }

    tarball, err := os.Open(src)
    if err != nil {
        return err
    }
    defer tarball.Close()

    gzr, err := gzip.NewReader(tarball)
    if err != nil {
        return err
    }
    defer gzr.Close()

    targz := tar.NewReader(gzr)

    for {
        header, err := targz.Next()

        if err == io.EOF {
            return nil
        } else if err != nil {
            return err
        } else if header == nil {
            continue
        }

        target := filepath.Join(dest, header.Name)

        switch header.Typeflag {
        case tar.TypeDir:
            if _, err := os.Stat(target); err != nil {
                if err := os.MkdirAll(target, os.FileMode(header.Mode)); err != nil {
                    return err
                }
            }

        case tar.TypeReg:
            f, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode))
            if err != nil {
                return err
            }

            if _, err := io.Copy(f, targz); err != nil {
                return err
            }

            f.Close()
        }
    }
}

Any guidance or notes here would be greatly appreciated if you spot something that doesn't seem right, thanks!