Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: import path may have alias name #172

Merged
merged 7 commits into from
Nov 12, 2024
Merged

fix: import path may have alias name #172

merged 7 commits into from
Nov 12, 2024

Conversation

y1yang0
Copy link
Member

@y1yang0 y1yang0 commented Nov 8, 2024

In hook code, if we import some package along with alias name and alias package is used within hook code, the compilation fails

import (
	erralias "errors"

	"github.com/alibaba/opentelemetry-go-auto-instrumentation/pkg/api"
)

func onEnterErrorsNewAlias(call api.CallContext, text string) {
	// Check if alias name confuses compilation
	_ = erralias.ErrUnsupported
}

In this case, we will replace "github.com/alibaba/opentelemetry-go-auto-instrumentation/pkg/api" to "errors" and we have two "errors", which finally leads to failure.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.60%. Comparing base (c2472a2) to head (d7bf3a0).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage   82.60%   82.60%           
=======================================
  Files          18       18           
  Lines         713      713           
=======================================
  Hits          589      589           
  Misses        102      102           
  Partials       22       22           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@y1yang0 y1yang0 force-pushed the yyang/rename_pkgname branch from d84a0db to 5ad4f1e Compare November 8, 2024 08:29
@y1yang0 y1yang0 force-pushed the yyang/rename_pkgname branch from 5ad4f1e to 22f0f51 Compare November 8, 2024 08:34
@y1yang0
Copy link
Member Author

y1yang0 commented Nov 11, 2024

Can I have a review? Maybe @123liuziming. The failed tests look like unrelated to this PR

@123liuziming
Copy link
Collaborator

123liuziming commented Nov 11, 2024

Can I have a review? Maybe @123liuziming. The failed tests look like unrelated to this PR

Grpc has released v1.68.0 2 days ago. I will support the latest Grpc release this week.

@y1yang0
Copy link
Member Author

y1yang0 commented Nov 11, 2024

Can I have a review? Maybe @123liuziming. The failed tests look like unrelated to this PR

Grpc has released v1.68.0 2 days ago. I will support the latest Grpc release this week.

Thanks!

@123liuziming 123liuziming mentioned this pull request Nov 11, 2024
@y1yang0 y1yang0 merged commit 378efdb into main Nov 12, 2024
7 checks passed
@y1yang0 y1yang0 deleted the yyang/rename_pkgname branch November 12, 2024 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants