This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"log" | |
) | |
type F func() error | |
func errCompose(pipeline ...F) (e error, ok bool) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" this reloads the file after formatting | |
" while preserving current view and undo history | |
function! GoFmtSave() | |
:undoj " do not create undo history entry | |
let l:oldx = getpos("'x") " save current x mark | |
let l:oldy = getpos("'y") " save current y mark | |
:norm! mxHmy " mark current position and top of screen | |
!gofmt -w % " call gofmt on the current file | |
:e " reload file |