${1/^main$|(.+)/(?1:\/*
+ ${1/^main$|(.+)/(?1:/*
The $1 package implements ... bananas?
-*\/
+*/
)/}package ${1:main}
name
Package
diff --git a/Snippets/Test.tmSnippet b/Snippets/Test.tmSnippet
new file mode 100644
index 0000000..6d9bb65
--- /dev/null
+++ b/Snippets/Test.tmSnippet
@@ -0,0 +1,28 @@
+
+
+
+
+ content
+ package ${1:`base="${TM_FILEPATH%_test.go}.go"
+if [[ -f "$base" ]] && grep -q '^package ' "$base"
+ then grep -m1 '^package ' "$base"|cut -d' ' -f2
+ else echo 'main'
+fi`}
+
+import (
+ "testing"
+)
+
+func Test${2:${TM_DISPLAYNAME/^(.*?)(_test)?(\.go)?$/${1:/capitalize}/}}(t *testing.T) {
+ $0t.Fatal("no test body")
+}
+ name
+ Test
+ scope
+ source.go
+ tabTrigger
+ test
+ uuid
+ C6F66AFB-B50B-45AF-B2B2-819CC3464E56
+
+
diff --git a/Support/goerrs.rb b/Support/goerrs.rb
deleted file mode 100755
index 5fd0a7f..0000000
--- a/Support/goerrs.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env ruby
-
-require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
-require "pathname"
-
-module Go
- def Go::normalize_file(file)
- return nil if file == 'untitled'
- return file if Pathname.new(file).absolute?
- base = ENV['TM_PROJECT_DIRECTORY'] || ENV['TM_DIRECTORY'] || Dir.getwd
- File.join(base, file)
- end
-
- def Go::href(file, line)
- file = normalize_file(file)
- link = "txmt://open?line=#{line}"
- link << "&url=file://#{e_url(file)}" if file
- link
- end
-
- def Go::link_errs(str, type)
- if str.count(':') == 2
- str.gsub!(/^(.+):(\d+):\s+(.+)$/) do
- file, line, msg = $1, $2, $3
- text = ""
- text << "#{htmlize(File.basename(file))}:#{line}"
- text << ": #{htmlize(msg)}
"
- text
- end
- else
- str.gsub!(/^(.+):(\d+):(\d+):\s+(.+)$/) do
- file, line, col, msg = $1, $2, $3, $4
- text = ""
- text << "#{htmlize(File.basename(file))}:#{line}"
- text << ": #{htmlize(msg)}
"
- text
- end
- end
- end
-end
diff --git a/Support/gomate.rb b/Support/gomate.rb
index 5e765e6..6c2b5a2 100755
--- a/Support/gomate.rb
+++ b/Support/gomate.rb
@@ -6,7 +6,6 @@
require "#{ENV['TM_SUPPORT_PATH']}/lib/web_preview"
require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/executor"
require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/save_current_document"
-require "#{ENV['TM_BUNDLE_SUPPORT']}/goerrs"
# TextMate's special GOPATH used in .tm_properties files prepended to the environment's GOPATH
ENV['GOPATH'] = (ENV.has_key?('TM_GOPATH') ? ENV['TM_GOPATH'] : '') +
@@ -25,6 +24,7 @@ def Go::go(command, options={})
if command == 'test' && ENV['TM_FILENAME'] =~ /(_test)?(\.go)$/
basename = $`
+ args.push("-v")
args.push("#{basename}.go")
args.push("#{basename}_test.go")
opts[:chdir] = ENV['TM_DIRECTORY']
@@ -90,13 +90,8 @@ def Go::gofmt
if err.nil? || err == ''
puts out
else
- html_header("Formatting \"#{ENV['TM_FILENAME']}\"...", "go",
- # html_head below is used to style the error lines like those displayed when a compiler error occurs
- :html_head => '')
- puts ''
- puts Go::link_errs(err, :err)
- puts '
'
- html_footer
+ args << {:use_hashbang => false, :version_args => ['version'], :version_regex => /\Ago version (.*)/}
+ TextMate::Executor.run(*args)
TextMate.exit_show_html
end
end
diff --git a/info.plist b/info.plist
index eb920cb..8ea3728 100644
--- a/info.plist
+++ b/info.plist
@@ -20,7 +20,9 @@
0F6A8710-54FC-48F5-9D02-D093DA001D17
73628139-0077-4F09-9B72-77546D7C2D2D
------------------------------------
+ D3CD6B51-3A7E-4356-85F4-B76B8336BEF2
7BCFCFC8-9152-4638-8436-E17B0C754C8D
+ ------------------------------------
B0271A46-F6EF-4D2F-95A6-EC067E69155C
------------------------------------
C64599DA-E362-4411-9782-58A9C7F1B05A
@@ -104,6 +106,7 @@
CFE21C25-71DE-48A9-8FE6-2A40D8DF16EF
2DFA9510-6F88-4BC6-A409-DA4075DEA8FF
5E6327B4-8BD5-4079-8B25-D8D3EF9E89FB
+ C6F66AFB-B50B-45AF-B2B2-819CC3464E56
name
Organization