Fix syntax consistency
This commit is contained in:
		
							parent
							
								
									0339b45090
								
							
						
					
					
						commit
						eb4e6e8772
					
				@ -24,16 +24,16 @@ func StatusHandler(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	infoJson, _ := json.Marshal(info)
 | 
			
		||||
	w.Write(infoJson)
 | 
			
		||||
	jsn, _ := json.Marshal(info)
 | 
			
		||||
	w.Write(jsn)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func DebugHandler(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	info := make(map[string]int)
 | 
			
		||||
	info["goroutines"] = runtime.NumGoroutine()
 | 
			
		||||
 | 
			
		||||
	infoJson, _ := json.Marshal(info)
 | 
			
		||||
	w.Write(infoJson)
 | 
			
		||||
	jsn, _ := json.Marshal(info)
 | 
			
		||||
	w.Write(jsn)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func PublishHandler(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								state.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								state.go
									
									
									
									
									
								
							@ -24,9 +24,9 @@ func SaveState() {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	stateJson, _ := json.Marshal(state)
 | 
			
		||||
	jsn, _ := json.Marshal(state)
 | 
			
		||||
	key := Key(StateMetaKey)
 | 
			
		||||
	if err := storage.Set(key, stateJson); err != nil {
 | 
			
		||||
	if err := storage.Set(key, jsn); err != nil {
 | 
			
		||||
		Error(err, "Failed to persist state")
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
@ -36,13 +36,14 @@ func LoadState() {
 | 
			
		||||
	state := make(ServerState)
 | 
			
		||||
	key := Key(StateMetaKey)
 | 
			
		||||
 | 
			
		||||
	stateJson, err := storage.Get(key)
 | 
			
		||||
	jsn, err := storage.Get(key)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		Log("State not found")
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := json.Unmarshal(stateJson, &state); err != nil {
 | 
			
		||||
	err = json.Unmarshal(jsn, &state)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		Log("Failed to load state")
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user