Skip to content

Instantly share code, notes, and snippets.

@roscopecoltran
roscopecoltran / main.go
Created November 16, 2018 00:18 — forked from arehmandev/main.go
Doing a git clone of a tag in Go - the easy way
package main
import (
"log"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4"
)
@roscopecoltran
roscopecoltran / detect_dirty_worktree.go
Created November 16, 2018 00:18 — forked from tyru/detect_dirty_worktree.go
Try to detect worktree (currently not working)
package main
import (
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"strings"
package main
import (
"fmt"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/utils/ioutil"
)
func main() {
@roscopecoltran
roscopecoltran / main.go
Created November 16, 2018 00:17 — forked from rms1000watt/main.go
Clone Git Repo in Pure Go
import (
"errors"
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws/session"
@roscopecoltran
roscopecoltran / walk_go-git_inmemory_worktree.go
Created November 16, 2018 00:16 — forked from athurg/walk_go-git_inmemory_worktree.go
遍历go-git内存文件系统的工作区
package main
import (
"fmt"
"io/ioutil"
"os"
"gopkg.in/src-d/go-billy.v3"
"gopkg.in/src-d/go-billy.v3/memfs"
"gopkg.in/src-d/go-git.v4"
@roscopecoltran
roscopecoltran / wayback.go
Created November 16, 2018 00:15 — forked from davidwalter0/wayback.go
x/vgo: thoughts on selection criteria for non-versioned go repo
// https://gist.github.com/davidwalter0/60f41b53732656c5c546cc8b0a739d11
// x/vgo: thoughts on selection criteria for non-versioned go repo
// Run git branch version selection for non-vgo versioned repository
// as if in a wayback machine.
// Use the dependency's commit ctime as the wayback ctime.
// Commits prior to the wayback ctime in sub-dependencies are eligible.
// Use the newest commit prior to the wayback ctime.
package main
import (
"errors"
"flag"
"fmt"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/go-git.v4/utils/merkletrie"
@roscopecoltran
roscopecoltran / main.go
Created November 16, 2018 00:15 — forked from dweomer/main.go
2018-04-26 - Golang Phoenix - Package Madness! - https://www.meetup.com/Golang-Phoenix/events/249838312/
package main
// https://www.meetup.com/Golang-Phoenix/events/249838312/
// I was assigned the 'gopkg.in/src-d/go-git.v4' package. Below is a simple program that will take a Git URL,
// clone the repo, and scan SemVer-compliant tags then output the most recent, as per SemVer, version.
import (
"fmt"
"io/ioutil"
"os"
// Adding a file directly to index (stage area), without using working tree.
//
// $ go build index-add.go && yes | mv index-add ~/code/workspace/bin
// $ mkdir -p /tmp/sample && cd /tmp/sample
// $ index-add
package main
import (
"bytes"
"fmt"
@roscopecoltran
roscopecoltran / AAAReadme.md
Created November 16, 2018 00:13 — forked from owulveryck/AAAReadme.md
Markdown on the fly

Usage

go run *go github.com/owulveryck/test/