Skip to content

Instantly share code, notes, and snippets.

View wejick's full-sized avatar

Gian Giovani wejick

View GitHub Profile
package main
import (
"sync"
"github.com/wejick/daging/repo/productcard"
"github.com/wejick/daging/repo/productinfo"
"github.com/wejick/daging/repo/productrating"
"github.com/wejick/daging/repo/shoprating"
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wejick
wejick / simple_web_server.go
Created June 3, 2017 19:07
simple web server
package main
import "net/http"
func main() {
http.HandleFunc("/", handler)
http.HandleFunc("/test", handler)
http.ListenAndServe(":8080", nil)
}
@wejick
wejick / slice.go
Created May 2, 2017 08:45
[golang] Removing element from slice
//RemoveFromSlice remove string from slice, return number of removed items
func RemoveFromSlice(slice []string, toRemove string) (removed []string, n int) {
for _, i := range slice {
if i != toRemove {
removed = append(removed, i)
} else {
n++
}
}
return