sless-primer/POSTGRES/code/stress-go-nil/handler.go
Naeel 4b04cde84b chore(examples): remove stale examples, keep only POSTGRES
- Deleted: TNAR, demo-event-log, demo-managed-functions, hello-go, hello-node,
  k8s, notes-python, pg-list-python, simple-node, simple-python
- POSTGRES: removed luceUNDnode.tf (commented-out legacy), stress_log_1.txt,
  funcs_list.py; disabled stress_destroy_apply.sh (PG lifecycle stress has
  delete_user bug); added README.md
- examples/README.md: updated to reflect current state (sless_service + sless_job)
2026-03-21 07:49:23 +03:00

22 lines
603 B
Go

// 2026-03-19
// handler.go — намеренный nil pointer dereference в Go.
// Проверяет что Go runtime recover() перехватывает панику и платформа возвращает 500.
// Entrypoint: handler.Handle
package handler
func Handle(event map[string]interface{}) interface{} {
crash := true
if v, ok := event["crash"].(bool); ok {
crash = v
}
if crash {
var p *string
_ = *p // panic: намеренный nil pointer для stress-теста
}
return map[string]interface{}{
"runtime": "go1.23",
"version": "v1",
"crashed": false,
}
}