A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/orgrim/pg_back/commit/4ba77e5e1f172cc9be43a09773ec8f1772dd0c60 below:

Use SplitSeq when possible · orgrim/pg_back@4ba77e5 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+7

-7

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+7

-7

lines changed Original file line number Diff line number Diff line change

@@ -51,15 +51,15 @@ func hookCommand(cmd string, logPrefix string) error {

51 51

c := exec.Command(prog, args...)

52 52

stdoutStderr, err := c.CombinedOutput()

53 53

if err != nil {

54 -

for _, line := range strings.Split(string(stdoutStderr), "\n") {

54 +

for line := range strings.SplitSeq(string(stdoutStderr), "\n") {

55 55

if line != "" {

56 56

l.Errorln(logPrefix, line)

57 57

}

58 58

}

59 59

return err

60 60

}

61 61

if len(stdoutStderr) > 0 {

62 -

for _, line := range strings.Split(string(stdoutStderr), "\n") {

62 +

for line := range strings.SplitSeq(string(stdoutStderr), "\n") {

63 63

if line != "" {

64 64

l.Infoln(logPrefix, line)

65 65

}

Original file line number Diff line number Diff line change

@@ -239,7 +239,7 @@ func convertLegacyConf(oldConf []string) string {

239 239

case "PGBK_DBLIST", "PGBK_EXCLUDE":

240 240

// The separator for lists of databases now the comma

241 241

dbs := make([]string, 0)

242 -

for _, d := range strings.Split(strings.Trim(value, "'\""), " ") {

242 +

for d := range strings.SplitSeq(strings.Trim(value, "'\""), " ") {

243 243

if len(d) > 0 {

244 244

dbs = append(dbs, d)

245 245

}

Original file line number Diff line number Diff line change

@@ -706,7 +706,7 @@ func (d *dump) dump(fc chan<- sumFileJob) error {

706 706

l.Verboseln("running:", pgDumpCmd)

707 707

stdoutStderr, err := pgDumpCmd.CombinedOutput()

708 708

if err != nil {

709 -

for _, line := range strings.Split(string(stdoutStderr), "\n") {

709 +

for line := range strings.SplitSeq(string(stdoutStderr), "\n") {

710 710

if line != "" {

711 711

l.Errorf("[%s] %s\n", dbname, line)

712 712

}

@@ -718,7 +718,7 @@ func (d *dump) dump(fc chan<- sumFileJob) error {

718 718

return err

719 719

}

720 720

if len(stdoutStderr) > 0 {

721 -

for _, line := range strings.Split(string(stdoutStderr), "\n") {

721 +

for line := range strings.SplitSeq(string(stdoutStderr), "\n") {

722 722

if line != "" {

723 723

l.Infof("[%s] %s\n", dbname, line)

724 724

}

@@ -979,15 +979,15 @@ func dumpGlobals(dir string, mode int, timeFormat string, withRolePasswords bool

979 979

l.Verboseln("running:", pgDumpallCmd)

980 980

stdoutStderr, err := pgDumpallCmd.CombinedOutput()

981 981

if err != nil {

982 -

for _, line := range strings.Split(string(stdoutStderr), "\n") {

982 +

for line := range strings.SplitSeq(string(stdoutStderr), "\n") {

983 983

if line != "" {

984 984

l.Errorln(line)

985 985

}

986 986

}

987 987

return err

988 988

}

989 989

if len(stdoutStderr) > 0 {

990 -

for _, line := range strings.Split(string(stdoutStderr), "\n") {

990 +

for line := range strings.SplitSeq(string(stdoutStderr), "\n") {

991 991

if line != "" {

992 992

l.Infoln(line)

993 993

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4