Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 241 for newi (0.06 sec)

  1. test/fixedbugs/bug099.go

    // Arg is unused but important:
    // if you take it out (and the 0s below)
    // then the bug goes away.
    func NewI(i int) I {
    	return new(S)
    }
    
    // Uses interface method.
    func Use(x I) {
    	x.F()
    }
    
    func main() {
    	i := NewI(0);
    	Use(i);
    
    	// Again, without temporary
    	// Crashes because x.F is 0.
    	Use(NewI(0));
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 18 21:15:42 UTC 2012
    - 637 bytes
    - Viewed (0)
  2. src/fmt/print.go

    func parsenum(s string, start, end int) (num int, isnum bool, newi int) {
    	if start >= end {
    		return 0, false, end
    	}
    	for newi = start; newi < end && '0' <= s[newi] && s[newi] <= '9'; newi++ {
    		if tooLarge(num) {
    			return 0, false, end // Overflow; crazy long number most likely.
    		}
    		num = num*10 + int(s[newi]-'0')
    		isnum = true
    	}
    	return
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:22:43 UTC 2024
    - 31.8K bytes
    - Viewed (0)
  3. src/fmt/fmt_test.go

    			t.Errorf("parsenum(%q, %d, %d) = %d, %v, %d, want %d, %v, %d", tt.s, tt.start, tt.end, num, isnum, newi, tt.num, tt.isnum, tt.newi)
    		}
    	}
    }
    
    // Test the various Append printers. The details are well tested above;
    // here we just make sure the byte slice is updated.
    
    const (
    	appendResult = "hello world, 23"
    	hello        = "hello "
    )
    
    func TestAppendf(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:55 UTC 2024
    - 58.6K bytes
    - Viewed (0)
  4. test/typeparam/issue50598.dir/a0.go

    // license that can be found in the LICENSE file.
    
    package a0
    
    type Builder[T any] struct{}
    
    func (r Builder[T]) New1() T {
    	var v T
    	return v
    }
    
    func (r Builder[T]) New2() T {
    	var v T
    	return v
    }
    
    type IntBuilder struct{}
    
    func (b IntBuilder) New() int {
    	return Builder[int]{}.New2()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 14 16:41:18 UTC 2022
    - 398 bytes
    - Viewed (0)
  5. tests/named_argument_test.go

    	if err := DB.Exec("UPDATE named_users SET name1 = @name, name2 = @name2, name3 = @name", sql.Named("name", "jinzhu-new"), sql.Named("name2", "jinzhu-new2")).Error; err != nil {
    		t.Errorf("failed to update with named arg")
    	}
    
    	namedUser.Name1 = "jinzhu-new"
    	namedUser.Name2 = "jinzhu-new2"
    	namedUser.Name3 = "jinzhu-new"
    
    	var result5 NamedUser
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Dec 21 11:50:00 UTC 2021
    - 2.7K bytes
    - Viewed (0)
  6. tests/hooks_test.go

    	DB.Model(&product).Updates(map[string]interface{}{"Name": "Product New"})
    
    	if product.Name != "Product New" || product.Price != 160 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code changed, but not selected, price should not change
    	DB.Model(&product).Select("Name", "Price").Updates(map[string]interface{}{"Name": "Product New2", "code": "L1213"})
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Feb 18 01:20:29 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/runtime/extension_test.go

    			t.Errorf("2nd unmarshal error: %v", err)
    		}
    		if !bytes.Equal(data, newData) {
    			t.Errorf("%s: re-marshaled data differs from original: %v %v", k, data, newData)
    		}
    		if !reflect.DeepEqual(tc.orig, new1) {
    			t.Errorf("%s: unmarshaled struct differs from original: %v %v", k, tc.orig, new1)
    		}
    		if !reflect.DeepEqual(new1, new2) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 08 22:36:37 UTC 2017
    - 2.8K bytes
    - Viewed (0)
  8. test/typeparam/issue50552.dir/a.go

    package a
    
    type Builder[T any] struct{}
    
    func (r Builder[T]) New() T {
    	var v T
    	return v
    }
    
    func (r Builder[T]) New2() T {
    	return r.New()
    }
    
    func BuildInt() int {
    	return Builder[int]{}.New()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 11 21:51:51 UTC 2022
    - 196 bytes
    - Viewed (0)
  9. test/fixedbugs/issue56778.dir/b.go

    // Copyright 2022 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package b
    
    import "./a"
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 17 18:31:28 UTC 2022
    - 203 bytes
    - Viewed (0)
  10. platforms/software/dependency-management/src/test/groovy/org/gradle/internal/component/external/model/DefaultMutableMavenModuleResolveMetadataTest.groovy

            def id = DefaultModuleComponentIdentifier.newId(DefaultModuleIdentifier.newId("group", "module"), "version")
            def newId = DefaultModuleComponentIdentifier.newId(DefaultModuleIdentifier.newId("group", "module"), "1.2")
            def sources = ImmutableModuleSources.of(Stub(ModuleSource))
    
            def metadata = mavenMetadataFactory.create(id, [])
    
            when:
            metadata.id = newId
            metadata.sources = sources
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed May 15 00:21:07 UTC 2024
    - 11.9K bytes
    - Viewed (0)
Back to top