MCPcopy
hub / github.com/ChineseSubFinder/ChineseSubFinder / WriteStrings2File

Function WriteStrings2File

pkg/util.go:394–411  ·  view source on GitHub ↗
(desfilePath string, strings []string)

Source from the content-addressed store, hash-verified

392}
393
394func WriteStrings2File(desfilePath string, strings []string) error {
395 dstFile, err := os.Create(desfilePath)
396 if err != nil {
397 return err
398 }
399 defer func() {
400 _ = dstFile.Close()
401 }()
402 allString := ""
403 for _, s := range strings {
404 allString += s + "\r\n"
405 }
406 _, err = dstFile.WriteString(allString)
407 if err != nil {
408 return err
409 }
410 return nil
411}
412
413func TimeNumber2Time(inputTimeNumber float64) time.Time {
414 newTime := time.Time{}.Add(time.Duration(inputTimeNumber * math.Pow10(9)))

Callers

nothing calls this directly

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected