From b3dd001bc8cc282c75105ba229e0c55e5a4b3252 Mon Sep 17 00:00:00 2001 From: jet2tlf Date: Mon, 3 Jun 2024 13:48:36 -0300 Subject: codecrafters submit [skip ci] --- app/status.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/status.go (limited to 'app/status.go') diff --git a/app/status.go b/app/status.go new file mode 100644 index 0000000..6a905c9 --- /dev/null +++ b/app/status.go @@ -0,0 +1,24 @@ +package main + +type status struct { + code int + text string +} + +type Status interface { + Code() int + Text() string +} + +var ( + Ok Status = &status{200, "OK"} + NotFound Status = &status{404, "Not Found"} +) + +func (s *status) Code() int { + return s.code +} + +func (s *status) Text() string { + return s.text +} -- cgit v1.2.3