---
title: "Methods aren't for \"objects\""
url: https://daily.dev/posts/methods-aren-t-for-objects--fvnuv9q95
source_url: https://boldlygo.tech/archive/2023-07-24-methods-arent-for-objects
type: article
source: "Boldly Go"
published: 2026-05-31T07:50:21.302Z
updated: 2026-05-31T09:14:08.521Z
tags: ["golang"]
reading_time: 2
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Methods aren't for "objects"

**[Boldly Go](https://daily.dev/sources/boldlygo)** · 2 min read · 0 upvotes · 0 comments

## Summary

Go allows methods to be defined on any named type, not just structs or objects. This includes primitive-backed types like custom integers (e.g., TimeZone based on int) and even function types. The net/http package's HandlerFunc is a real-world example of methods on a function type, implementing the ServeHTTP interface. This flexibility is highlighted as one of Go's most powerful features compared to languages that require wrapping primitives in objects.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://boldlygo.tech/archive/2023-07-24-methods-arent-for-objects>

---

Tags: [#golang](https://daily.dev/tags/golang)

[View this post on daily.dev](https://daily.dev/posts/methods-aren-t-for-objects--fvnuv9q95)
