Skip to content

Commit a177198

Browse files
committed
remote main?
1 parent e8eef7f commit a177198

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
#if: "!contains(github.event.pull_request.title, '[NO-REGRESSION-TEST]')"
1515
env:
16-
LANGS: "go rust python typescript"
16+
LANGS: "go"
1717
# ignore package version for Go e.g. 'a.b/c@506fb8ece467f3a71c29322169bef9b0bc92d554'
1818
DIFFJSON_IGNORE: >
1919
['id']

lang/golang/parser/file.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,15 @@ func (p *GoParser) parseASTNode(ctx *fileContext, node ast.Node, collect *collec
394394
// return false
395395
// }
396396
if use, ok := ctx.pkgTypeInfo.Uses[expr]; ok {
397-
id := NewIdentity(ctx.module.Name, ctx.pkgPath, callName)
397+
pkg := use.Pkg()
398+
if pkg == nil {
399+
return true
400+
}
401+
mod, err := ctx.GetMod(pkg.Path())
402+
if err != nil {
403+
return true
404+
}
405+
id := NewIdentity(mod, pkg.Path(), use.Name())
398406
dep := NewDependency(id, ctx.FileLine(expr))
399407
// type name
400408
if _, isNamed := use.(*types.TypeName); isNamed {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2025 CloudWeGo Authors
2+
//
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+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package pkg
16+
17+
import . "a.b/c/pkg/entity"
18+
19+
var G2 = G1
20+
21+
var I1 Integer
22+
23+
type S MyStructD
24+
25+
func CaseMergeRef() MyStruct {
26+
_ = G1 + G2
27+
return MyStruct{
28+
MyStructD: MyStructD{},
29+
}
30+
}

0 commit comments

Comments
 (0)