Skip to content

Commit 6734068

Browse files
palnabarunRaghavRoy145
authored andcommitted
revert uintended code change
Signed-off-by: Nabarun Pal <[email protected]> Return just slice and map to functions instead of pointers to them Signed-off-by: Raghav Roy <[email protected]>
1 parent 9fedf97 commit 6734068

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
// rootCmd represents the base command when called without any subcommands
2424
var rootCmd = &cobra.Command{
2525
Use: "maintainers",
26-
Short: "tool for maintaining OWNERS files in kubernetes hello",
26+
Short: "tool for maintaining OWNERS files in kubernetes",
2727
}
2828

2929
// Execute adds all child commands to the root command and sets flags appropriately.

cmd/validate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var validateCmd = &cobra.Command{
6969
}
7070

7171
groupMap := context.PrefixToGroupMap()
72-
fileMap, errors := validateOwnersFilesInGroups(&groupMap)
72+
fileMap, errors := validateOwnersFilesInGroups(groupMap)
7373
errors2 := warnFileMismatchesBetweenKubernetesRepoAndSigsYaml(fileMap)
7474
errors = append(errors, errors2...)
7575

@@ -94,7 +94,7 @@ func warnFileMismatchesBetweenKubernetesRepoAndSigsYaml(fileMap map[string]strin
9494
continue
9595
}
9696
found := false
97-
for _, file := range *ownerFiles {
97+
for _, file := range ownerFiles {
9898
if len(file) == 0 {
9999
continue
100100
}
@@ -107,7 +107,7 @@ func warnFileMismatchesBetweenKubernetesRepoAndSigsYaml(fileMap map[string]strin
107107
}
108108
}
109109

110-
for _, file := range *ownerFiles {
110+
for _, file := range ownerFiles {
111111
if len(file) > 0 {
112112
if _, ok := fileMap[file]; !ok {
113113
errors = append(errors, fmt.Errorf("file [%s] is not in sigs.yaml", file))
@@ -118,10 +118,10 @@ func warnFileMismatchesBetweenKubernetesRepoAndSigsYaml(fileMap map[string]strin
118118
return errors
119119
}
120120

121-
func validateOwnersFilesInGroups(groupMap *map[string][]utils.Group) (map[string]string, []error) {
121+
func validateOwnersFilesInGroups(groupMap map[string][]utils.Group) (map[string]string, []error) {
122122
fileMap := map[string]string{}
123123
var errors []error
124-
for groupType, groups := range *groupMap {
124+
for groupType, groups := range groupMap {
125125
for _, group := range groups {
126126
for _, sub := range group.Subprojects {
127127
for _, filePath := range sub.Owners {

pkg/utils/github_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func FetchPRCommentCount(user, repository string) (int, error) {
7676
return strconv.Atoi(fmt.Sprintf("%v", result["total_count"]))
7777
}
7878

79-
func GetKubernetesOwnersFiles() (*[]string, error) {
79+
func GetKubernetesOwnersFiles() ([]string, error) {
8080
resp, err := http.Get("https://api.github.com/repos/kubernetes/kubernetes/git/trees/master?recursive=1")
8181
if err != nil {
8282
return nil, err
@@ -108,5 +108,5 @@ func GetKubernetesOwnersFiles() (*[]string, error) {
108108
directories = append(directories, directory.Path)
109109
}
110110
}
111-
return &directories, nil
111+
return directories, nil
112112
}

0 commit comments

Comments
 (0)