sql-machine-learning / sqlflow

Brings SQL and AI together.
https://sqlflow.org
Apache License 2.0
5.05k stars 697 forks source link

use go std tar gzip api instead of tar command #3128

Closed awsl-dbq closed 2 years ago

awsl-dbq commented 3 years ago

https://github.com/sql-machine-learning/sqlflow/blob/develop/go/model/model.go#L182 https://github.com/sql-machine-learning/sqlflow/blob/develop/go/model/model.go#L210

The code

cmd := exec.Command("tar", "czf", "-", "-C", m.workDir, ".")

It's better to use the go

"archive/tar"
"compress/gzip"

API

sometimes redirect to stdin "-" is not work for some environment