Skip to content

Commit

Permalink
Add reflect package to collisions map
Browse files Browse the repository at this point in the history
Summary:
We will begin using "reflect" downstream.
Ensure that collisions are handled properly.

Reviewed By: leoleovich

Differential Revision: D63477977

fbshipit-source-id: 1ebf50ebafcd636faaa4762a98c7bd8eb74fab06
  • Loading branch information
echistyakov authored and facebook-github-bot committed Sep 27, 2024
1 parent 57d6ca5 commit b71f6cb
Show file tree
Hide file tree
Showing 104 changed files with 207 additions and 0 deletions.
2 changes: 2 additions & 0 deletions thrift/compiler/generate/templates/go/svcs.go.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import (
"context"
"fmt"
"reflect"
"strings"

{{#program:thrift_imports}}
Expand All @@ -38,6 +39,7 @@ import (
// (needed to ensure safety because of naive import list construction)
var _ = context.Background
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO
{{#program:gen_metadata?}}
Expand Down
2 changes: 2 additions & 0 deletions thrift/compiler/generate/templates/go/types.go.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import (
"fmt"
"reflect"
"strings"

{{#program:thrift_imports}}
Expand All @@ -29,6 +30,7 @@ import (
{{> common/unused_imports_protection}}
// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
1 change: 1 addition & 0 deletions thrift/compiler/lib/go/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class codegen_data {
{"sync", 0},
{"metadata", 0},
{"maps", 0},
{"reflect", 0},
};

struct go_munged_names_cache_key_ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package module
import (
"context"
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
Expand All @@ -18,6 +19,7 @@ import (
// (needed to ensure safety because of naive import list construction)
var _ = context.Background
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO
var _ = metadata.GoUnusedProtection__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package module

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package cpp

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package hack

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package python

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package rust

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package scope

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package thrift

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package module
import (
"context"
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
Expand All @@ -18,6 +19,7 @@ import (
// (needed to ensure safety because of naive import list construction)
var _ = context.Background
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO
var _ = metadata.GoUnusedProtection__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package module

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package cpp

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package go_

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package hack

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package scope

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package thrift

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package module
import (
"context"
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
Expand All @@ -18,6 +19,7 @@ import (
// (needed to ensure safety because of naive import list construction)
var _ = context.Background
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO
var _ = metadata.GoUnusedProtection__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package module

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package hack

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package scope

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package thrift

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package module

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ package cpp

import (
"fmt"
"reflect"
"strings"

thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
)

// (needed to ensure safety because of naive import list construction)
var _ = fmt.Printf
var _ = reflect.Ptr
var _ = strings.Split
var _ = thrift.ZERO

Expand Down
Loading

0 comments on commit b71f6cb

Please sign in to comment.