Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: experimental/webtry/webtry.go

Issue 244133002: Picking from the wrong end of the workspace history list. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package main 1 package main
2 2
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "crypto/md5" 5 "crypto/md5"
6 "database/sql" 6 "database/sql"
7 "encoding/base64" 7 "encoding/base64"
8 "encoding/json" 8 "encoding/json"
9 "flag" 9 "flag"
10 "fmt" 10 "fmt"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 log.Printf("Error: failed to fetch from database: %q", err) 430 log.Printf("Error: failed to fetch from database: %q", err)
431 continue 431 continue
432 } 432 }
433 tries = append(tries, Try{Hash: hash, CreateTS: create_ts.Format("2006-02-01")}) 433 tries = append(tries, Try{Hash: hash, CreateTS: create_ts.Format("2006-02-01")})
434 } 434 }
435 } 435 }
436 var code string 436 var code string
437 if len(tries) == 0 { 437 if len(tries) == 0 {
438 code = DEFAULT_SAMPLE 438 code = DEFAULT_SAMPLE
439 } else { 439 } else {
440 » » » code = getCode(tries[len(tries)-1].Hash) 440 » » » code = getCode(tries[0].Hash)
441 } 441 }
442 if err := workspaceTemplate.Execute(w, Workspace{Tries: tries, C ode: code, Name: name}); err != nil { 442 if err := workspaceTemplate.Execute(w, Workspace{Tries: tries, C ode: code, Name: name}); err != nil {
443 log.Printf("ERROR: Failed to expand template: %q\n", err ) 443 log.Printf("ERROR: Failed to expand template: %q\n", err )
444 } 444 }
445 } else if r.Method == "POST" { 445 } else if r.Method == "POST" {
446 name, err := newWorkspace() 446 name, err := newWorkspace()
447 if err != nil { 447 if err != nil {
448 http.Error(w, "Failed to create a new workspace.", 500) 448 http.Error(w, "Failed to create a new workspace.", 500)
449 return 449 return
450 } 450 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 flag.Parse() 600 flag.Parse()
601 http.HandleFunc("/i/", imageHandler) 601 http.HandleFunc("/i/", imageHandler)
602 http.HandleFunc("/w/", workspaceHandler) 602 http.HandleFunc("/w/", workspaceHandler)
603 http.HandleFunc("/recent/", recentHandler) 603 http.HandleFunc("/recent/", recentHandler)
604 http.HandleFunc("/iframe/", iframeHandler) 604 http.HandleFunc("/iframe/", iframeHandler)
605 http.HandleFunc("/css/", cssHandler) 605 http.HandleFunc("/css/", cssHandler)
606 http.HandleFunc("/js/", jsHandler) 606 http.HandleFunc("/js/", jsHandler)
607 http.HandleFunc("/", mainHandler) 607 http.HandleFunc("/", mainHandler)
608 log.Fatal(http.ListenAndServe(*port, nil)) 608 log.Fatal(http.ListenAndServe(*port, nil))
609 } 609 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698