mirror of
https://github.com/grafana/grafana.git
synced 2025-01-07 22:53:56 -06:00
Chore: Fix cue imports when we don't use an alias (#61795)
Fix cue imports when we don't use an alias
This commit is contained in:
parent
b1efd911c1
commit
c1251311d0
@ -64,7 +64,7 @@ func convertImport(im *ast.ImportSpec) (tsast.ImportSpec, error) {
|
||||
if im.Name != nil && im.Name.String() != "" {
|
||||
tsim.AsName = im.Name.String()
|
||||
} else {
|
||||
sl := strings.Split(im.Path.Value, "/")
|
||||
sl := strings.Split(strings.Trim(im.Path.Value, "\""), "/")
|
||||
final := sl[len(sl)-1]
|
||||
if idx := strings.Index(final, ":"); idx != -1 {
|
||||
tsim.AsName = final[idx:]
|
||||
|
Loading…
Reference in New Issue
Block a user