Permalink
Browse files

rename the bundled Go syntax to `GoSublime: Go (Copy)` to make it cle…

…ar what it is
  • Loading branch information...
DisposaBoy committed Sep 14, 2018
1 parent 66c12f3 commit f48d9d8683cd60b6980d0f2b29425d1d3d60cfa2
Showing with 10 additions and 1 deletion.
  1. +1 −1 something_borrowed/Go/Go.sublime-syntax
  2. +9 −0 something_borrowed/Go/generate.go
@@ -1,7 +1,7 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Go
name: 'GoSublime: Go (Copy)'
file_extensions:
- go
first_line_match: "-[*]-( Mode:)? Go -[*]-"
@@ -6,6 +6,7 @@
package main

import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
@@ -18,6 +19,7 @@ type dlFile struct {
name string
url string
dirs []string
filt func(s []byte) []byte
}

func main() {
@@ -36,6 +38,9 @@ func main() {
name: "Go.sublime-syntax",
url: "https://raw.githubusercontent.com/sublimehq/Packages/master/Go/Go.sublime-syntax",
dirs: []string{"."},
filt: func(s []byte) []byte {
return bytes.Replace(s, []byte("name: Go"), []byte("name: 'GoSublime: Go (Copy)'"), -1)
},
},
}
for _, f := range urls {
@@ -64,6 +69,10 @@ func dl(f dlFile) {
return
}

if f.filt != nil {
content = f.filt(content)
}

for _, dir := range f.dirs {
ioutil.WriteFile(filepath.Join(dir, f.name), content, 0644)
if err != nil {

0 comments on commit f48d9d8

Please sign in to comment.