Skip to content

Commit c012f08

Browse files
Merge pull request #13 from AlexsanderHamir/refactors
small improvements
2 parents 174638e + ad1bdae commit c012f08

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

cli/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ func CreateRootCmd() *cobra.Command {
3838
RunE: runBenchmarks,
3939
}
4040

41-
rootCmd.AddCommand(createManualCmd())
42-
rootCmd.AddCommand(createRunCmd())
41+
rootCmd.AddCommand(createProfManual())
42+
rootCmd.AddCommand(createProfAuto())
4343
rootCmd.AddCommand(createSetupCmd())
4444
rootCmd.AddCommand(createTrackCmd())
4545
rootCmd.AddCommand(createVersionCmd())
4646

4747
return rootCmd
4848
}
4949

50-
func createManualCmd() *cobra.Command {
50+
func createProfManual() *cobra.Command {
5151
manualCmd := &cobra.Command{
5252
Use: shared.MANUALCMD,
5353
Short: "Receives profile files and performs data collection and organization. (doesn't wrap go test)",
@@ -65,7 +65,7 @@ func createManualCmd() *cobra.Command {
6565
return manualCmd
6666
}
6767

68-
func createRunCmd() *cobra.Command {
68+
func createProfAuto() *cobra.Command {
6969
benchFlag := "benchmarks"
7070
profileFlag := "profiles"
7171
tagFlag := "tag"

parser/api.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,3 @@ func GetAllProfileLines(scanner *bufio.Scanner, lines *[]string) {
149149
*lines = append(*lines, scanner.Text())
150150
}
151151
}
152-
153-
func removeHeader(scanner *bufio.Scanner) {
154-
for scanner.Scan() {
155-
line := scanner.Text()
156-
if strings.Contains(line, header) {
157-
break
158-
}
159-
}
160-
}

parser/helpers.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package parser
22

33
import (
4+
"bufio"
45
"fmt"
56
"regexp"
67
"strconv"
@@ -235,3 +236,12 @@ func createLineObjects(lines []string) ([]*LineObj, error) {
235236

236237
return lineObjs, nil
237238
}
239+
240+
func removeHeader(scanner *bufio.Scanner) {
241+
for scanner.Scan() {
242+
line := scanner.Text()
243+
if strings.Contains(line, header) {
244+
break
245+
}
246+
}
247+
}

tests/helpers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ var (
2424
type TestArgs struct {
2525
specifiedFiles map[fileFullName]*FieldsCheck
2626
cfg config.Config
27+
expectedNumberOfFiles int
28+
expectedErrorMessage string
29+
label string
30+
cmd []string
31+
expectedProfiles []string
2732
withConfig bool
2833
expectNonSpecifiedFiles bool
2934
noConfigFile bool
30-
cmd []string
31-
expectedErrorMessage string
32-
label string
33-
expectedNumberOfFiles int
3435
withCleanUp bool
35-
expectedProfiles []string
3636
blockOutputCheck bool
3737
isEnvironmentSet bool
3838
checkSuccessMessage bool

0 commit comments

Comments
 (0)