(depth int)
| 1851 | } |
| 1852 | |
| 1853 | func (j jsonObject) allPathsWithDepth(depth int) ([]JSON, error) { |
| 1854 | if len(j) == 0 || depth == 0 { |
| 1855 | return []JSON{j}, nil |
| 1856 | } |
| 1857 | ret := make([]JSON, 0, len(j)) |
| 1858 | for i := range j { |
| 1859 | var paths []JSON |
| 1860 | var err error |
| 1861 | if depth > 0 { |
| 1862 | paths, err = j[i].v.allPathsWithDepth(depth - 1) |
| 1863 | } else { |
| 1864 | paths, err = j[i].v.allPathsWithDepth(depth) |
| 1865 | } |
| 1866 | if err != nil { |
| 1867 | return nil, err |
| 1868 | } |
| 1869 | for _, path := range paths { |
| 1870 | ret = append(ret, jsonObject{jsonKeyValuePair{k: j[i].k, v: path}}) |
| 1871 | } |
| 1872 | } |
| 1873 | return ret, nil |
| 1874 | } |
| 1875 | |
| 1876 | // FromDecimal returns a JSON value given a apd.Decimal. |
| 1877 | func FromDecimal(v apd.Decimal) JSON { |
nothing calls this directly
no test coverage detected