Add Go XML to structure tags
The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.
Start file
package main // FooXML mapping from XML to struct type FooXML struct { Field1 string Field2 string Field3 string }
End file
package main // FooXML mapping from XML to struct type FooXML struct { Field1 string `xml:"field1"` Field2 string `xml:"field2"` Field3 string `xml:"field3"` }
View Diff
5,7c5,7 < Field1 string < Field2 string < Field3 string --- > Field1 string `xml:"field1"` > Field2 string `xml:"field2"` > Field3 string `xml:"field3"`
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 68 remaining solutions by signing in and submitting your own entry
#69 Vincent Le / @Vinnyoodles - Score: 106 - 07/02/17 @ 03:49
Gkkkjk$a <BS><Esc>bbBjjkbbBBBBBBBBjjbbbbjbBBBBjll$<C-V>jj<Esc>kkl<C-V>jjI <BS>g `xml: <BS>"field`"`<BS><BS><BS>1"`<Esc>jk$a<BS><Esc>jlxjlxhhkr2jr3<Esc>:wq<CR>
0 comments