Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 5957c3356f7e17045b00002c

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 by @GavinKoeng:

Unlock 11 remaining solutions by signing in and submitting your own entry
Created by: @KaizenSoze70

75 active golfers, 195 entries

Solutions by @GavinKoeng:
23
#6 - Gavin / @GavinKoeng

03/12/2026 at 03:31PM

23
#>6 - Gavin / @GavinKoeng

03/12/2026 at 03:32PM

24
#>18 - Gavin / @GavinKoeng

03/12/2026 at 03:31PM

25
#>27 - Gavin / @GavinKoeng

03/12/2026 at 03:30PM

26
#>29 - Gavin / @GavinKoeng

03/12/2026 at 03:29PM

28
#>36 - Gavin / @GavinKoeng

03/12/2026 at 03:29PM

29
#>41 - Gavin / @GavinKoeng

03/12/2026 at 03:29PM

30
#>50 - Gavin / @GavinKoeng

03/12/2026 at 03:28PM

31
#>59 - Gavin / @GavinKoeng

03/12/2026 at 03:26PM

33
#>70 - Gavin / @GavinKoeng

03/12/2026 at 03:27PM

40
#>70 - Gavin / @GavinKoeng

03/12/2026 at 03:25PM