package file import ( "os" "path" "strings" "gitstore.ru/tolikproh/sirius/internal/service" ) func FileConvert(srcFilePathName string) error { srcDir, srcFileName := path.Split(srcFilePathName) dstFileName := strings.Split(srcFileName, ".")[0] + ".xlsx" buffer, err := os.ReadFile(srcDir + srcFileName) if err != nil { return err } respBuff, err := service.SiriusConv(buffer) if err != nil { return err } err = os.WriteFile(srcDir+dstFileName, respBuff.Bytes(), 0644) if err != nil { return err } return nil }