Open
Description
Hello!
I have a global var block as follows:
var (
SystemSubsystem = "system"
SystemLabelNames = []string{"hostname", "resource", "system_id"}
SystemMemoryLabelNames = []string{"hostname", "resource", "memory", "memory_id"}
// and so on
)
Let's say I want to insert a new variable SystemProcessorLabelNames
after the SystemMemoryLabelNames
This doesn't work:
@@
@@
SystemMemoryLabelNames = []string{"hostname", "resource", "memory", "memory_id"}
+SystemProcessorLabelNames = []string{"hostname", "resource", "processor", "processor_id"}
And this doesn't work:
@@
@@
var (
...
SystemMemoryLabelNames = []string{"hostname", "resource", "memory", "memory_id"}
+SystemProcessorLabelNames = []string{"hostname", "resource", "processor", "processor_id"}
)
Although replacing works fine like that:
@@
@@
-[]string{"hostname", "resource", "memory", "memory_id"}
+[]string{"hostname", "resource", "processor", "processor_id"}
But I need to append a new line. Appending works fine inside functions, just like that:
@@
@@
a := 5
+b:=6
But inside var block it either fails or skips the file. Is this a bug or my mistake? Thanks.