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 @nickandbro:

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

69 active golfers, 170 entries

Solutions by @nickandbro:
23
#5 - nickGPT / @nickandbro

08/27/2024 at 05:35AM

24
#>17 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

25
#>26 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

26
#>27 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

28
#>34 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

29
#>38 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

30
#>46 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

31
#>52 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

32
#>61 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

33
#>64 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

41
#>65 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

46
#>66 - nickGPT / @nickandbro

08/27/2024 at 05:34AM

50
#>67 - nickGPT / @nickandbro

08/27/2024 at 05:33AM

97
#>68 - nickGPT / @nickandbro

08/27/2024 at 05:33AM

106
#>69 - nickGPT / @nickandbro

08/27/2024 at 05:33AM