pub fn fmt(self: *User) []const u8 {
const buf: []u8 = undefined;
const str = try std.fmt.bufPrint(buf, "age:{d} name:{s} job:{any}\n", .{ self.age, self.name, self.job });
std.debug.print("buf:{s}\n", .{buf});
std.debug.print("str:{s}\n", .{str});
return buf;
}
fmt-example.zig:11:21: error: expected type '[]const u8', found 'error{NoSpaceLeft}'
const str = try std.fmt.bufPrint(buf, "age:{d} name:{s} job:{any}\n", .{ self.age, self.name, self.job });