How to: [⏫](#contents) :gift: Automatically set memory and cpu limits in K8S
Go can automatically detect container environment cpu and memory limits. This ensures better utilization. Starting Go 1.25 `GOMAXPROCS` is K8S aware and sets it from `limits.cpu` automatically.

```yaml
- name: GOMEMLIMIT
  valueFrom:
    resourceFieldRef:
      resource: limits.memory
```

Requirements
```
go 1.25+
```