• 0 Posts
  • 1 Comment
Joined 7 months ago
cake
Cake day: June 12th, 2024

help-circle
  • 0x00toProgrammingWhy is Go syntax so messy
    link
    fedilink
    arrow-up
    7
    ·
    7 months ago

    My least favorite part of Go, by far, is the capitalization as struct member visibility thing. That and the not super great json encoding annotations.

    Here’s a sample:

    type Change struct {
    	Path             string `json:"path"`
    	Category         string `json:"category"` // change, append, create, delete
    	Position         int64  `json:"position"`
    	Size             int64  `json:"size"`
    	OriginalChecksum string `json:"original_checksum"`
    	UpdatedChecksum  string `json:"updated_checksum"`
    	UnixTimestamp    int64  `json:"unix_timestamp"`
    	Data             []byte `json:"data"`
    	MatchedRules     []Rule `json:"matched_rules"`
    }
    

    I would take explicit public declarators any day