@@ -64,11 +64,27 @@ func newDiffCmd() *cobra.Command {
6464 }
6565
6666 f := cmd .Flags ()
67- f .StringVarP (& o .token , "access-token" , "t" , "" , "Access token of the current user." )
68- f .BoolVarP (& o .brief , "brief" , "q" , false , `If not set, differences in the contents of the
69- files in the two workspaces are shown.` )
67+ f .StringVarP (
68+ & o .token ,
69+ "access-token" ,
70+ "t" ,
71+ "" ,
72+ "Access token of the current user." ,
73+ )
74+ f .BoolVarP (
75+ & o .brief ,
76+ "brief" ,
77+ "q" ,
78+ false ,
79+ `If not set, differences in the contents of the
80+ files in the two workspaces are shown.` ,
81+ )
7082 f .IntVarP (
71- & o .unified , "unified" , "u" , 5 , "Sets number of context lines for workspace diff output." ,
83+ & o .unified ,
84+ "unified" ,
85+ "u" ,
86+ 5 ,
87+ "Sets number of context lines for workspace diff output." ,
7288 )
7389
7490 return cmd
@@ -100,7 +116,10 @@ func (o *diffOptions) run(cmd *cobra.Command) error {
100116 return nil
101117}
102118
103- func displayDiffPayload (cmd * cobra.Command , p * operations.GetWorkflowDiffOKBody ) error {
119+ func displayDiffPayload (
120+ cmd * cobra.Command ,
121+ p * operations.GetWorkflowDiffOKBody ,
122+ ) error {
104123 if p .ReanaSpecification != "" {
105124 specificationDiff := orderedmap .New ()
106125 err := json .Unmarshal ([]byte (p .ReanaSpecification ), & specificationDiff )
@@ -120,21 +139,31 @@ func displayDiffPayload(cmd *cobra.Command, p *operations.GetWorkflowDiffOKBody)
120139 sectionDiffs , _ := specificationDiff .Get (section )
121140 linesInterface , ok := sectionDiffs .([]any )
122141 if ! ok {
123- return fmt .Errorf ("expected diff to be an array, got %v" , sectionDiffs )
142+ return fmt .Errorf (
143+ "expected diff to be an array, got %v" ,
144+ sectionDiffs ,
145+ )
124146 }
125147 lines := make ([]string , 0 , len (linesInterface ))
126148 for _ , line := range linesInterface {
127149 lineString , ok := line .(string )
128150 if ! ok {
129- return fmt .Errorf ("expected diff line to be a string, got %v" , line )
151+ return fmt .Errorf (
152+ "expected diff line to be a string, got %v" ,
153+ line ,
154+ )
130155 }
131156 lines = append (lines , lineString )
132157 }
133158
134159 if len (lines ) != 0 {
135160 equalSpecification = false
136161 displayer .PrintColorable (
137- fmt .Sprintf ("%s Differences in workflow %s\n " , config .LeadingMark , section ),
162+ fmt .Sprintf (
163+ "%s Differences in workflow %s\n " ,
164+ config .LeadingMark ,
165+ section ,
166+ ),
138167 cmd .OutOrStdout (),
139168 text .FgYellow ,
140169 text .Bold ,
@@ -144,7 +173,10 @@ func displayDiffPayload(cmd *cobra.Command, p *operations.GetWorkflowDiffOKBody)
144173 }
145174 if equalSpecification {
146175 displayer .PrintColorable (
147- fmt .Sprintf ("%s No differences in REANA specifications.\n " , config .LeadingMark ),
176+ fmt .Sprintf (
177+ "%s No differences in REANA specifications.\n " ,
178+ config .LeadingMark ,
179+ ),
148180 cmd .OutOrStdout (),
149181 text .FgYellow ,
150182 text .Bold ,
@@ -162,7 +194,10 @@ func displayDiffPayload(cmd *cobra.Command, p *operations.GetWorkflowDiffOKBody)
162194 workspaceDiff := datautils .SplitLinesNoEmpty (workspaceDiffRaw )
163195
164196 displayer .PrintColorable (
165- fmt .Sprintf ("%s Differences in workflow workspace\n " , config .LeadingMark ),
197+ fmt .Sprintf (
198+ "%s Differences in workflow workspace\n " ,
199+ config .LeadingMark ,
200+ ),
166201 cmd .OutOrStdout (),
167202 text .FgYellow ,
168203 text .Bold ,
0 commit comments