Sublime Forum

How to add snippet in GoSublime for func test(http.ResponseWriter, r *http.Request)

#1

I’m trying to add a snippet for autocompletion in the GoSublime package. As every go developer I write lots of functions that take an http.ResponseWriter and *http.Request as arguments.

I tried putting the following in my GoSublime user settings, but it doesn’t work. What am I doing wrong?

{
"snippets": [
	{
		"match": {"local": true},
		"snippets": [
			{"text": "(w http.ResponseWriter, r *http.Request)", "title": "(w http.ResponseWriter, r *http.Request)", "value": "(w http.ResponseWriter, r *http.Request) {\n\t$0\n}\n"}
		]
	}
]

}

0 Likes