-nnoremap <silent> <buffer> ]] :call <SID>Go_jump('/^\(func\\|type\)')<cr>
-nnoremap <silent> <buffer> [[ :call <SID>Go_jump('?^\(func\\|type\)')<cr>
-nnoremap <silent> <buffer> ]m :call <SID>Go_jump('/^\s*\(func\\|type\)')<cr>
-nnoremap <silent> <buffer> [m :call <SID>Go_jump('?^\s*\(func\\|type\)')<cr>
-
-if exists('*<SID>Go_jump') | finish | endif
-
-fun! <SID>Go_jump(motion) range
- let cnt = v:count1
- let save = @/ " save last search pattern
- mark '
- while cnt > 0
- silent! exe a:motion
- let cnt = cnt - 1
- endwhile
- call histdel('/', -1)
- let @/ = save " restore last search pattern
-endfun
+vim9script
+if exists("*go#jump#Do") | finish | endif
+nnoremap <silent> <buffer> ]] :call go#jump#Do(':/^\(func\\|type\)')<CR>
+nnoremap <silent> <buffer> [[ :call go#jump#Do(':?^\(func\\|type\)')<CR>
+nnoremap <silent> <buffer> ]m :call go#jump#Do(':/^\s*\(func\\|type\)')<CR>
+nnoremap <silent> <buffer> [m :call go#jump#Do(':?^\s*\(func\\|type\)')<CR>