Skip to content

Commit

Permalink
Removed Not Needed Variables
Browse files Browse the repository at this point in the history
  • Loading branch information
LennyGPT committed Sep 7, 2023
1 parent 9c71ee6 commit 9cd9bcc
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func main() {
defer file.Close()

var set settings
err = json.NewDecoder(file).Decode(&set)
if err != nil {
if json.NewDecoder(file).Decode(&set) != nil {
fmt.Println(err)
return
}
Expand Down Expand Up @@ -128,19 +127,16 @@ func getpixel(w http.ResponseWriter, r *http.Request) {
return
}

erstring := boundcheck(locX, locY)
if erstring != "n.a" {
if erstring := boundcheck(locX, locY); erstring != "n.a" {
http.Error(w, erstring, http.StatusForbidden)
}

re, g, b, a := cimg.At(locX, locY).RGBA()

if a == 0 {
info := info{T: false}
json.NewEncoder(w).Encode(info)
json.NewEncoder(w).Encode(info{T: false})
} else {
info := info{R: uint8(re), G: uint8(g), B: uint8(b), T: true}
json.NewEncoder(w).Encode(info)
json.NewEncoder(w).Encode(info{R: uint8(re), G: uint8(g), B: uint8(b), T: true})
}

}
Expand Down Expand Up @@ -228,8 +224,7 @@ func pixelplace(locX int, locY int, R, G, B uint8) {
// Admin Pixel Placing
func rectangle(lX, lY, lX2, lY2 int) {
fmt.Print("Drawing White Recetangle... \n")
rect := image.Rect(lX, lY, lX2, lY2)
draw.Draw(cimg, rect, &image.Uniform{color.White}, image.Point{lX, lX2}, draw.Over)
draw.Draw(cimg, image.Rect(lX, lY, lX2, lY2), &image.Uniform{color.White}, image.Point{lX, lX2}, draw.Over)
fmt.Print("Rectangle completed! \n")
}

Expand Down

0 comments on commit 9cd9bcc

Please sign in to comment.