Browse Source

more golint simplifications

Marty Schoch 2 years ago
parent
commit
667371dbec

+ 2 - 2
registry/analyzer.go

@@ -75,8 +75,8 @@ func (c *AnalyzerCache) DefineAnalyzer(name string, typ string, config map[strin
 func AnalyzerTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range analyzers {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/char_filter.go

@@ -75,8 +75,8 @@ func (c *CharFilterCache) DefineCharFilter(name string, typ string, config map[s
 func CharFilterTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range charFilters {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/datetime_parser.go

@@ -75,8 +75,8 @@ func (c *DateTimeParserCache) DefineDateTimeParser(name string, typ string, conf
 func DateTimeParserTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range dateTimeParsers {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/fragment_formatter.go

@@ -75,8 +75,8 @@ func (c *FragmentFormatterCache) DefineFragmentFormatter(name string, typ string
 func FragmentFormatterTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range fragmentFormatters {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/fragmenter.go

@@ -75,8 +75,8 @@ func (c *FragmenterCache) DefineFragmenter(name string, typ string, config map[s
 func FragmenterTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range fragmenters {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/highlighter.go

@@ -75,8 +75,8 @@ func (c *HighlighterCache) DefineHighlighter(name string, typ string, config map
 func HighlighterTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range highlighters {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/index_type.go

@@ -36,8 +36,8 @@ func IndexTypeConstructorByName(name string) IndexTypeConstructor {
 }
 
 func IndexTypesAndInstances() ([]string, []string) {
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name := range stores {
 		types = append(types, name)
 	}

+ 2 - 2
registry/store.go

@@ -36,8 +36,8 @@ func KVStoreConstructorByName(name string) KVStoreConstructor {
 }
 
 func KVStoreTypesAndInstances() ([]string, []string) {
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name := range stores {
 		types = append(types, name)
 	}

+ 2 - 2
registry/token_filter.go

@@ -75,8 +75,8 @@ func (c *TokenFilterCache) DefineTokenFilter(name string, typ string, config map
 func TokenFilterTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range tokenFilters {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/token_maps.go

@@ -75,8 +75,8 @@ func (c *TokenMapCache) DefineTokenMap(name string, typ string, config map[strin
 func TokenMapTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range tokenMaps {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {

+ 2 - 2
registry/tokenizer.go

@@ -75,8 +75,8 @@ func (c *TokenizerCache) DefineTokenizer(name string, typ string, config map[str
 func TokenizerTypesAndInstances() ([]string, []string) {
 	emptyConfig := map[string]interface{}{}
 	emptyCache := NewCache()
-	types := make([]string, 0)
-	instances := make([]string, 0)
+	var types []string
+	var instances []string
 	for name, cons := range tokenizers {
 		_, err := cons(emptyConfig, emptyCache)
 		if err == nil {