以编程方式创建嵌套数组

I want to test my serialization format for robustnes and want to serialize a nested array. The Serialization actually dies at some point, but I don't know at what depth exactly. Right now I just define a large array manually, but I want to do it programatically, so I can figure out when exactly the depth is too high. Changing the code for each iteration is tedious...

l := [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]string {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{"a"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

What I want is something like this:

l := "a"
while(1){
    l = {l} //nest the slice/array once more
    print("round ", i)
    i++
}

I'm a Golang newbie and I don't know how I can get around the type-safety in this case.

In go you can't change the type of a variable so you need to use interface{} as type var l interface{} now you could do something like:

l = "a"
for i:= 0;i<3;i++{
    l = []interface{}{l}
}

printing l would give the output [[[a]]], same as [][][]string{{{"a"}}}.

A problem is that you lose your type and it will be impossible to do something like l[0][0][0] to get the value. As far as I now you would need to cast everything l.([]interface{})[0].([]interface{})[0].([]interface{})[0].(string)