Comments (7)
@kud202 @HirdrWit
Sorry for late.
It's fixed in v0.1.11
from exportloopref.
Give me a code to reproduce it.
from exportloopref.
@kyoh86 I ran into this, here's a minimal test case I could form:
https://github.com/kud202/testExportRef
from exportloopref.
It looks like Obj
is nil
for some reason when the variable is defined outside the file:
https://github.com/kyoh86/exportloopref/blob/main/exportloopref.go#L301
from exportloopref.
Sorry for late. I cannot check it out up to 2 weeks ahead.
from exportloopref.
No problem, take a look when you are free.
Also, after looking at it a bit more, I think it might be safe to do a just a nil
check there. I can PR that. Because from what I can tell that value is only nil
if the variable if A] there is a syntax error and B] the variable is defined outside the file. In either case, it cannot be a local variable, so it might be safe to return false
in the function if that value is nil.
But I hope you get it eventually 👍
from exportloopref.
Thanks !
from exportloopref.
Related Issues (14)
- fails to find out what scopelint does HOT 7
- False positive when a loop var is exported, directly followed by break HOT 5
- False positive when exporting a pointer to a loop variable field. HOT 1
- possible false negative when assigning a new struct with loop variable to a local var HOT 7
- False positive when ranging over a slice of pointers HOT 1
- take sliced arrays into account
- No reports about using variable on range scope in function literal (deprecated `scopelint` finds it perfectly) HOT 1
- Forbid captured loop variables HOT 3
- panic in checkUnaryExpr HOT 4
- exportloopref may be able to check decendants member like `a.b.c.d...`
- Suggest fixes
- golangci-lint fails on exportloopref for go v1.13 HOT 3
- Any benefits compared to gosec and scopelint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exportloopref.