Skip to content

Instantly share code, notes, and snippets.

View rodkranz's full-sized avatar

Rodrigo Lopes rodkranz

View GitHub Profile
@rodkranz
rodkranz / nested.go
Last active May 18, 2018 09:30
Simple Nested in GO
package main
import (
"testing"
"fmt"
"reflect"
"strings"
)
// Implementation Nested
@rodkranz
rodkranz / image
Created July 19, 2018 18:14
get information of image without download all image
package main
import (
_ "image/png"
_ "image/gif"
_ "image/jpeg"
"time"
"net/http"
"log"
"io"
@rodkranz
rodkranz / CutBetweenText.go
Last active October 29, 2018 14:56
cut slice of text between start text and end text.
func CutBetweenText(s, start, end string) (string, bool) {
if !strings.HasPrefix(s, start) || !strings.HasSuffix(s, end) {
return "", false
}
if len(s) <= (len(start) + len(end)) {
return "", false
}
@rodkranz
rodkranz / update-git-folders.go
Last active March 27, 2020 11:24
Update all git repository in subfolders.
package main
import (
"flag"
"fmt"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"