Skip to content

Commit e37034a

Browse files
committed
Fix typo: Seperator -> Separator
1 parent 85fd79d commit e37034a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

v2/generator/import_tracker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ func goTrackerLocalName(tracker namer.ImportTracker, localPkg string, t types.Na
6161
path := t.Package
6262

6363
// Using backslashes in package names causes gengo to produce Go code which
64-
// will not compile with the gc compiler. See the comment on GoSeperator.
64+
// will not compile with the gc compiler. See the comment on GoSeparator.
6565
if strings.ContainsRune(path, '\\') {
6666
klog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path)
6767
}
6868
localLeaf := filepath.Base(localPkg)
6969

70-
dirs := strings.Split(path, namer.GoSeperator)
70+
dirs := strings.Split(path, namer.GoSeparator)
7171
for n := len(dirs) - 1; n >= 0; n-- {
7272
// follow kube convention of not having anything between directory names
7373
name := strings.Join(dirs[n:], "")

v2/namer/namer.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ import (
2626
)
2727

2828
const (
29-
// GoSeperator is used to split go import paths.
29+
// GoSeparator is used to split go import paths.
3030
// Forward slash is used instead of filepath.Seperator because it is the
3131
// only universally-accepted path delimiter and the only delimiter not
3232
// potentially forbidden by Go compilers. (In particular gc does not allow
3333
// the use of backslashes in import paths.)
3434
// See https://golang.org/ref/spec#Import_declarations.
3535
// See also https://github.com/kubernetes/gengo/issues/83#issuecomment-367040772.
36-
GoSeperator = "/"
36+
GoSeparator = "/"
37+
// GoSeperator is a typo for GoSeparator.
38+
// Deprecated: use GoSeparator instead.
39+
GoSeperator = GoSeparator
3740
)
3841

3942
// Returns whether a name is a private Go name.
@@ -200,7 +203,7 @@ var (
200203

201204
// filters out unwanted directory names and sanitizes remaining names.
202205
func (ns *NameStrategy) filterDirs(path string) []string {
203-
allDirs := strings.Split(path, GoSeperator)
206+
allDirs := strings.Split(path, GoSeparator)
204207
dirs := make([]string, 0, len(allDirs))
205208
for _, p := range allDirs {
206209
if ns.IgnoreWords == nil || !ns.IgnoreWords[p] {

0 commit comments

Comments
 (0)