From 96bcc15d6e3e820309c874fe39df11cb88b30af2 Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sat, 1 Mar 2025 20:10:26 +0000 Subject: Split logic to multiple files --- flat.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 flat.go (limited to 'flat.go') diff --git a/flat.go b/flat.go new file mode 100644 index 0000000..a655856 --- /dev/null +++ b/flat.go @@ -0,0 +1,19 @@ +package main + +import ( + "cmp" + "fmt" +) + +type flat struct { + ID int + Price string +} + +func (f *flat) URL() string { + return fmt.Sprintf("https://rightmove.co.uk/properties/%v", f.ID) +} + +func compareID(a, b flat) int { + return cmp.Compare(a.ID, b.ID) +} -- cgit v1.2.3-70-g09d2