Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing null values while printing in yaml format #60

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

Harisabdullah
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Aug 9, 2023

BE-2226 CLI YAML output should remove `null` entries

For out-of-tier data YAML option should not return any values instead of the current null response.

ipinfo ► ipinfo 8.8.8.8 --yaml
ip: 8.8.8.8
hostname: dns.google
bogon: false
anycast: true
city: Mountain View
region: California
country: US
countryname: United States
countryflag:
emoji: "\\U0001F1FA\\U0001F1F8"
unicode: U+1F1FA U+1F1F8
countrycurrency:
code: USD
symbol: $
continent:
code: NA
name: North America
iseu: false
location: 37.4056,-122.0775
org: AS15169 Google LLC
postal: "94043"
timezone: America/Los_Angeles
asn: null
company: null
carrier: null
privacy: null
abuse: null
domains: null

Preferred response:

ipinfo ► ipinfo 8.8.8.8 --yaml
ip: 8.8.8.8
hostname: dns.google
bogon: false
anycast: true
city: Mountain View
region: California
country: US
countryname: United States
countryflag:
emoji: "\\U0001F1FA\\U0001F1F8"
unicode: U+1F1FA U+1F1F8
countrycurrency:
code: USD
symbol: $
continent:
code: NA
name: North America
iseu: false
location: 37.4056,-122.0775
org: AS15169 Google LLC
postal: "94043"
timezone: America/Los_Angeles

This will match our normal response:

ipinfo ► ipinfo 8.8.8.8
Core

- IP 8.8.8.8
- Anycast true
- Hostname dns.google
- City Mountain View
- Region California
- Country United States (US)
- Currency USD ($)
- Location 37.4056,-122.0775
- Organization AS15169 Google LLC
- Postal 94043
- Timezone America/Los_Angeles

ipinfo ► ipinfo 8.8.8.8 --json
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"anycast": true,
"city": "Mountain View",
"region": "California",
"country": "US",
"country_name": "United States",
"country_flag": {
"emoji": "🇺🇸",
"unicode": "U+1F1FA U+1F1F8"
},
"country_currency": {
"code": "USD",
"symbol": "$"
},
"continent": {
"code": "NA",
"name": "North America"
},
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
}

@Harisabdullah Harisabdullah requested review from UmanShahzad and removed request for awaismslm August 9, 2023 08:45
ipinfo/core.go Outdated Show resolved Hide resolved
@UmanShahzad UmanShahzad merged commit d09f6bb into master Aug 9, 2023
@UmanShahzad
Copy link
Contributor

We need to update the version across the codebase here and push that as a tag. @Harisabdullah / @abu-usama can you handle it?

@UmanShahzad UmanShahzad deleted the haris/BE-2226 branch August 9, 2023 10:20
@UmanShahzad
Copy link
Contributor

Also don't forget the CHANGELOG entry

@abu-usama
Copy link
Contributor

@UmanShahzad Its done. Just needed update in user agent and change log. Pushed new tag v2.9.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants