Skip to content

Commit 2c8b37b

Browse files
authored
Merge pull request #467 from xushiwei/q
embeddedField: small change
2 parents 6da9266 + f30a644 commit 2c8b37b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

codebuild.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,8 +1832,7 @@ func (p *CodeBuilder) embeddedField(
18321832
o *types.Struct, name, aliasName string, flag MemberFlag, arg *Element, src ast.Node, visited map[*types.Struct]none) MemberKind {
18331833
if visited == nil {
18341834
visited = make(map[*types.Struct]none)
1835-
}
1836-
if _, ok := visited[o]; ok {
1835+
} else if _, ok := visited[o]; ok {
18371836
return MemberInvalid
18381837
}
18391838
visited[o] = none{}

codebuild_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
Copyright 2021 The GoPlus Authors (goplus.org)
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
114
package gogen
215

316
import (

0 commit comments

Comments
 (0)