forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg-go-dev.sh
executable file
·27 lines (24 loc) · 985 Bytes
/
pkg-go-dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Search Go Package Documentation
# @raycast.mode silent
#
# Optional parameters:
# @raycast.packageName Web Searches
# @raycast.icon images/go.png
# @raycast.argument1 { "type": "text", "placeholder": "Package", "percentEncoded": true }
# @raycast.argument2 { "type": "text", "placeholder": "Version (default: latest)", "optional": true }
# Note: For standard library packages, prefix the version with 'go'. For others, prefix with 'v'.
# Ex: To search for documentation on the 'time' package from Go version 1.12.3, pass 'go1.12.3'.
# To search for documentation on the 'github.com/gorilla/mux' package from version 1.7.0, pass 'v1.7.0'.
#
# Documentation:
# @raycast.author Phil Salant
# @raycast.authorURL https://github.com/PSalant726
# @raycast.description Search pkg.go.dev for package documentation
version=""
if [ -n "$2" ]; then
version="@$2"
fi
open "https://pkg.go.dev/$1$version"