Skip to content

Commit 7f4e474

Browse files
committed
Correct YAML support framing: Full support, not optional
🎯 Framing Correction: - Changed 'Optional YAML support' to 'Full YAML marshal/unmarshal support' - Removed YAML from 'Optional Advanced Features' section - Updated comparison table: 'Optional (with go-yaml)' → 'Full YAML marshal/unmarshal' - Enhanced serialization descriptions to include YAML as core feature 💡 Technical Accuracy: - UTC package implements MarshalYAML/UnmarshalYAML methods in main package - This follows standard Go pattern (same as JSON - requires external library) - Not 'optional' - it's full YAML support using Go's interface system - Works with any YAML library that implements Go's standard interfaces 📝 Updated Language: - 'Optional dependencies' → 'YAML Usage' with installation instructions - Removed 'testing-focused' language about YAML - Emphasized full YAML support comparable to JSON support - Clarified that external YAML library is standard Go pattern ✅ Consistent Positioning: - YAML now positioned as core serialization feature alongside JSON - Maintains technical honesty while proper feature representation - Aligns with how Go ecosystem typically handles serialization libraries This better represents the package's true capabilities - full YAML support that works with standard Go YAML libraries, not a limited optional feature.
1 parent 4b44c18 commit 7f4e474

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The `utc` package provides an enhanced, **zero-dependency** wrapper around Go's
2828
- **Rich formatting options** - US/EU dates, RFC standards, custom layouts
2929
- **Automatic timezone handling** - PST/PDT, EST/EDT transitions
3030
- **Flexible parsing** - Handles multiple input formats automatically
31-
- **Serialization ready** - JSON, Database, Text encoding (YAML optional)
31+
- **Serialization ready** - JSON, YAML, Database, Text encoding
3232

3333
### **⚡ Performance & Compatibility**
3434
- **Zero dependencies** - No external packages required
@@ -46,8 +46,10 @@ go get github.com/agentstation/utc
4646

4747
**Requirements**: Go 1.18 or later
4848

49-
**Optional dependencies**:
50-
- For YAML support: `github.com/goccy/go-yaml` (add with `go get github.com/goccy/go-yaml`)
49+
**YAML Usage**: The package includes full YAML support. To use YAML functionality, install a YAML library:
50+
```bash
51+
go get github.com/goccy/go-yaml # Recommended YAML library
52+
```
5153

5254
## Why Choose UTC? 🚀
5355

@@ -70,11 +72,10 @@ go get github.com/agentstation/utc
7072
- **Intuitive API** - familiar time.Time wrapper with enhanced functionality
7173
- **Rich formatting options** - US/EU date formats, RFC standards, custom layouts
7274
- **Automatic timezone handling** - PST/PDT, EST/EDT transitions handled correctly
73-
- **Serialization ready** - JSON, Database, Text encoding (YAML optional)
75+
- **Serialization ready** - JSON, YAML, Database, Text encoding
7476

7577
### ✅ **Optional Advanced Features**
76-
- **YAML support** - when you need it (testing-focused)
77-
- **Debug mode** - development-time nil pointer detection
78+
- **Debug mode** - development-time nil pointer detection
7879
- **Flexible parsing** - handles multiple time formats automatically
7980

8081
## Quick Start
@@ -114,7 +115,7 @@ See the difference between `utc` and Go's standard `time` package:
114115
| **Rich Formatting** | ❌ Manual layout strings | ✅ **Built-in US/EU/ISO formats** |
115116
| **Timezone Conversion** | ❌ Manual location loading | ✅ **Auto PST/PDT, EST/EDT handling** |
116117
| **JSON Support** | ✅ Basic marshal/unmarshal | ✅ **Enhanced parsing & formatting** |
117-
| **YAML Support** | ❌ No built-in support | ✅ **Optional (with go-yaml)** |
118+
| **YAML Support** | ❌ No built-in support | ✅ **Full YAML marshal/unmarshal** |
118119
| **Text Encoding** | ❌ Limited support | ✅ **Full MarshalText/UnmarshalText** |
119120
| **Database Ready** | ✅ Basic support | ✅ **Enhanced Scan/Value methods** |
120121
| **Unix Timestamps** | ✅ Basic Unix() method | ✅ **Unix + UnixMilli helpers** |
@@ -203,7 +204,7 @@ type Event struct {
203204
EndTime utc.Time `json:"end_time"`
204205
}
205206
206-
// YAML marshaling (optional, requires go-yaml)
207+
// YAML marshaling (requires a YAML library like go-yaml)
207208
type Config struct {
208209
StartTime utc.Time `yaml:"start_time"`
209210
EndTime utc.Time `yaml:"end_time"`
@@ -218,7 +219,7 @@ type Record struct {
218219
219220
## YAML Support
220221
221-
The package includes YAML marshaling/unmarshaling methods (`MarshalYAML`/`UnmarshalYAML`) that implement the standard YAML interfaces. However, **YAML support is primarily used for testing** and requires an external dependency.
222+
The package includes full YAML marshaling/unmarshaling support through `MarshalYAML`/`UnmarshalYAML` methods that implement the standard YAML interfaces. Works with any Go YAML library that follows these interfaces.
222223
223224
**Requirements for YAML testing**:
224225
- Go 1.21.0+ (required by go-yaml dependency)
@@ -314,7 +315,7 @@ Key features:
314315
315316
- All times are automatically converted to and stored in UTC
316317
- JSON marshaling/unmarshaling with flexible parsing
317-
- Optional YAML marshaling/unmarshaling (with go-yaml dependency)
318+
- Full YAML marshaling/unmarshaling support
318319
- SQL database compatibility with enhanced type support
319320
- Timezone conversion helpers with automatic DST handling
320321
- Extensive formatting options for US and EU date formats

0 commit comments

Comments
 (0)