This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
func main() { | |
http.HandleFunc("/", handler) | |
http.HandleFunc("/test", handler) | |
http.ListenAndServe(":8080", nil) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |