O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The endpoint to remove items from the shopping cart

Here's the source listing of RemoveItemFromShoppingCartEndpoint, the endpoint that is responsible for removing all items of a specific product from the shopping cart:

func RemoveItemFromShoppingCartEndpoint(env *common.Env) http.Handler {  return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {    igwSession, _ := env.Store.Get(r, "igweb-session")    decoder := json.NewDecoder(r.Body)    var m map[string]string    err := decoder.Decode(&m)    if err != nil {      log.Print("Encountered error when attempting to decode json data from request body: ", err)    }    defer r.Body.Close()    var cart *models.ShoppingCart    if _, ok := igwSession.Values["shoppingCart"]; ok == true { // Shopping Cart Exists in Session ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required